This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Preprocessor in #included Files


On Mon, Feb 12, 2007 at 03:03:04PM -0600, David Greene wrote:
> 
> Is this a known problem?  Is there a workaround?
> 

There is insufficient data to provide an answer.  If
the offending source code is available, and info about
your system is known, we might be able to help.

Given 

%cat test.h
integer a
#if defined(PROBLEM_A)
parameter(a = 1)
#elif defined(PROBLEM_B)
parameter(a = 2)
#else
#error "Select a problem"
#endif

%cat main.F90
program main
#include "test.h"
print *, a
end program main

troutmask:sgk[235] gfc41 --version
GNU Fortran 95 (GCC) 4.1.2 20070127 (prerelease)

troutmask:sgk[236] gfc42 --version
GNU Fortran 95 (GCC) 4.2.0 20070126 (prerelease)

troutmask:sgk[238] gfc4x --version
GNU Fortran 95 (GCC) 4.3.0 20070212 (experimental)


All compile the above.
-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]