- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I've got a strange problem in preprocessing. The (over-)simplified code reads:
program pippo
#if defined PIPPO
print*, 'PIPPO'
#elif defined PLUTO
print*, 'PLUTO'
#elif defined TOPOLINO
print*, 'TOPOLINO'
#else
print*, 'CIAO'
#endif
end program pippo
If I do:
ifort -fpp -DPIPPO -DTOPOLINO pippo.f90; ./a.out
it prints 'PIPPO' and 'CIAO' which should not be the case,
if I understand correctly.
Instead, when I:
ifort -fpp -DPLUTO -DTOPOLINO pippo.f90; ./a.out
it prints only 'PLUTO'.
Am I right?
Bye,
Davide
I've got a strange problem in preprocessing. The (over-)simplified code reads:
program pippo
#if defined PIPPO
print*, 'PIPPO'
#elif defined PLUTO
print*, 'PLUTO'
#elif defined TOPOLINO
print*, 'TOPOLINO'
#else
print*, 'CIAO'
#endif
end program pippo
If I do:
ifort -fpp -DPIPPO -DTOPOLINO pippo.f90; ./a.out
it prints 'PIPPO' and 'CIAO' which should not be the case,
if I understand correctly.
Instead, when I:
ifort -fpp -DPLUTO -DTOPOLINO pippo.f90; ./a.out
it prints only 'PLUTO'.
Am I right?
Bye,
Davide
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree with you that this behavior does not seem correct. If I run the code through cpp instead, I do not get the 'CIAO' line. Please report this to Intel Premier Support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#ifdef
#ifndef
#else
#endif
seem to work but you may have problems with
#if defined
#elif defined
I had similar problems with IVF on Windows
I never went back to see if they fixed the problem
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page