Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias of C_NULL_PTR to "NULL" clashes with Fortran intrinsic #40

Closed
jtappin opened this issue May 11, 2012 · 3 comments
Closed

Alias of C_NULL_PTR to "NULL" clashes with Fortran intrinsic #40

jtappin opened this issue May 11, 2012 · 3 comments

Comments

@jtappin
Copy link
Collaborator

jtappin commented May 11, 2012

While I was cleaning up some code, I updated some of its pointer definitions to intialize the pointers using the intrinsic null() function.

e.g.
real, dimension(:), pointer :: ptr = null()

to ensure a valid result for any call to associated().

Unfortunately by providing the convenience alias of NULL for C_NULL_PTR, we have made the intrinsic Fortran function inaccessible in any module that USEs the gtk fortran modules.

Not sure what's the best to do with the conflict. I know I've used the NULL constant extensively in my code.

@vmagnin
Copy link
Owner

vmagnin commented May 11, 2012

One solution would be to rename NULL in all the gtk-fortran files.
Another solution would be to locally rename NULL by using the following syntax:

use gtk, only: GTKNULL => NULL 

@jtappin
Copy link
Collaborator Author

jtappin commented May 16, 2012

Within the high-level routines, I've changed to the iso_c_binding native names (C_NULL_CHAR, C_NULL_PTR and C_NULL_FUNPTR).

@vmagnin
Copy link
Owner

vmagnin commented May 18, 2012

I have replaced NULL, CNULL, FNULL by the iso_c_binding names in all the remaining files of the project (master and gtk3 branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants