This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/43310] -pedantic errors on valid code involving PARAMETERs initialized to intrinsic function result



------- Comment #7 from kargl at gcc dot gnu dot org  2010-03-10 17:17 -------
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > 
> > > 
> > > "Not all valid FORTRAN 95 programs will compile properly when using this
> > > option.  If you want to ensure compliance with one of the FORTRAN standards,
> > > please see the -std= option."
> > > 
> > 
> > The problem is that your program does not conform to
> > the Fortran 95 standard.
> > 
> 
> It compiles without error nor warning with
> gfortran -std=f95 -Wall bar.f90
> 
> I'm not trying to sound argumentative here but you can't have it both ways...
> so are you saying that this is really a problem with -std, as opposed to
> -pedantic?

The issue is with -pedantic.  It doesn't do what one may think
it does.  When one uses -pedantic, it will strictly enforce a
range of [-huge():huge()] on integer types.  Without -pedantic,
the range is [-huge()-1:huge()].  There are issues with either
choice of range.  You found one with NOT(1).  Another issue is
with IABS() and the most negative integer value.

If you're trying to enforce standard conformance use -std=f95.
-pedantic has too much baggage from times before gfortran was
in the tree. 


-- 


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


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