[Bug fortran/68940] New: -Wno-error=compare-reals not working

jahns at dkrz dot de gcc-bugzilla@gcc.gnu.org
Wed Dec 16 16:13:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68940

            Bug ID: 68940
           Summary: -Wno-error=compare-reals not working
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jahns at dkrz dot de
  Target Milestone: ---

When combining the -Werror -Wextra -Wno-error=compare-reals options, code that
compares reals does still produce an error. Given the following example program
and compiler options, I was able to reproduce this behaviour with gfortran
5.1.0, 4.9.2 and 4.8.2:

$ cat gfortran-werror-wcompare-reals.f90
PROGRAM cmpreal
  REAL :: a, b
  READ *, a, b
  IF (a == b) PRINT *, 'equal'
END PROGRAM cmpreal
$ gfortran -Werror -Wextra -Wno-error=compare-reals -c -o
gfortran-werror-wcompare-reals.o gfortran-werror-wcompare-reals.f90
gfortran-werror-wcompare-reals.f90:4.6:

  IF (a == b) PRINT *, 'equal'
      1
Warning: Equality comparison for REAL(4) at (1)

$ echo $?
1
$ 

I think that this means -Wno-error=compare-reals does not reduce the
corresponding warning to only produce a warning.


More information about the Gcc-bugs mailing list