This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Silently checking whether diagnostics would occur
- To: jsm28 at cam dot ac dot uk
- Subject: Re: Silently checking whether diagnostics would occur
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Fri, 15 Sep 2000 14:25:35 -0400 (EDT)
- Cc: amylaar at cygnus dot co dot uk, gcc at gcc dot gnu dot org, gdr at codesourcery dot com, meissner at cygnus dot com
> From: "Joseph S. Myers" <jsm28@cam.ac.uk>
> >
> > Although I appreciate now the reasons against using a global var, I
> > also see maintenance problems down the road ensuring that one always
> > uses the above idiom when adding new format checks.
> >
> > Any ideas on making it more automatic and less dependent on good
> > behavior? Since `warning' is a varargs function, for portability
> > reasons I can't make the above snippet a macro.
>
> I'd suggest making this into a format_warning function (taking the int *
> and the normal warning() parameters).
Wouldn't I then have to use va_arg to process arguments and duplicate
the innards of the `warning' function? Eh, not too bad I guess.
> Remember the calls from tfaff() and
> maybe_read_dollar_number() and finish_dollar_format_checking() and adjust
> the parameters of these functions to include the int *, and note that
> format checking is not presently reentrant because of static variables
> used in the $ format checking (I've added reentrancy to my TODO list).
Thanks for the heads-up about those ancillary functions, I forgot
about them! Oh joy, another 10 warning spots on top of the 50 I
already have to fix. :-) BTW, I'll probably nuke tfaff, its a silly
one liner.
> In addition, -pedantic should not affect code generation, so before
> calling the format checking the value of `pedantic' should be saved and it
> should be set to some known value (I suggest 1).
Good point, thanks for the feedback.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions