[Bug fortran/56850] Diagnostic of REAL*8 is odd: Accepted with -std=f95, -pedantic prints warning only with -std=gnu

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 6 02:46:00 GMT 2019


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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
The reason it is called twice is because of the way the matchers work. Attempts
are made to match a particular feature or pattern. In each situation if an
error is found it is buffered in a list so that if a following matching attempt
is successful, the previous error condition can be dropped. My guess is when
-Werror is used, the first pass through the matchers returns a solid error and
even though the second is also an error one is treated as the first one and
acted on to emit the message. The case of the Syntax error is because the
matcher returned to the top of the hunt with no good match so, must be 'Syntax'
vs the other path giving the warning.

I also have been hitting the debugger on this. ne of the paths is via
gfc_match_data_decl and the other through gfc_match_prefix.

I have gotten as far as confirming, I think, that the code:

  const bool warning = (wstd != 0) && !inhibit_warnings;
  const bool error = (estd != 0);

is correct.

I am still digging on this so stand by for next round depending on how much
time I can find.


More information about the Gcc-bugs mailing list