http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46271

--- Comment #6 from janus at gcc dot gnu.org ---
Hi Marco,

> Janus, you are probably right that version B should not compile. I
> guess when I posted the bug report I was not sure which was the
> correct version according to the OpenMP specifications, since fp is a
> variable (requiring an OpenMP attribute), but it behaves like a
> subroutine (so, no OpenMP attribute).

well, since a procedure pointer can be assigned and change its value, I would
say it counts as a variable and one should make up one's mind whether it is
supposed to be shared or private in an OpenMP loop (as for any other variable,
this can clearly make a difference). Hence my interpretation that the error
message is correct.

However, I should note that I'm not much of an OpenMP expert and haven't
checked whether the OpenMP specifications makes any definitive statement about
this. It's merely my 'gut feeling'.


> As a note, I mention that ifort (version 13.1) accepts both versions,
> but maybe this is an issue with ifort itself.

ifort is not exactly known for it's strictness on invalid programs, and of
course it may have bugs. I don't know if this is allowed on purpose or if the
missing error is an oversight.

If ifort accepts the program, it would be interesting whether it treats the
procptr as private or shared with default(none), and whether this behavior is
documented somewhere (either in the OpenMP spec or the ifort docs).

Some people claim that documentation is the only thing that distinguishes a
feature from a bug ;)

Cheers,
Janus

Reply via email to