This is the mail archive of the gcc-patches@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]

Re: [PATCH,Fortran] Handle 'q' exponent-letter in real-literal-constant


On Wednesday 27 April 2011 01:06:26 Steve Kargl wrote:
> > > Index: primary.c
> > > ===================================================================
> > > --- primary.c   (revision 172974)
> > > +++ primary.c   (working copy)
> > > @@ -541,6 +541,17 @@ match_real_constant (gfc_expr **result,
> > > 
> > >      goto done;
> > >    
> > >    exp_char = c;
> > > 
> > > +
> > > +  if (c == 'q')
> > > +    {
> > > +      if (gfc_notify_std (GFC_STD_GNU, "Extension: exponent-letter 'q'
> > > in " +                        "real-literal-constant at %C") ==
> > > FAILURE) +       return MATCH_ERROR;
> > > +      else if (gfc_option.warn_real_q_constant)
> > > +       gfc_warning("Extension: exponent-letter 'q' in
> > > real-literal-constant
> > 
> > "
> > 
> > > +                   "at %C");
> > > +    }
> > 
> > I think the above could generate double warnings. With -pedantic for
> > example (but I didn't check).
> 
> It's an 'if -- else if' construct.  If gfc_notify_std == FAILURE, then
> the error message is issues and the function returns.   If it is TRUE,
> then there should be no messages and else if() is tested.
My concern is that gfc_notify_std seems to return SUCCESS on warnings (I can't 
test right now as make has decided to rebuild the whole middle-end :-(). Then, 
I expect double warnings with -pedantic -Wreal-q-constant as -pedantic is a 
(the only one ?) case outputing warnings for GNU extensions.

Mikael


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