From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kaveh R. Ghazi" To: jsm28@cam.ac.uk Cc: amylaar@cygnus.co.uk, gcc@gcc.gnu.org, gdr@codesourcery.com, meissner@cygnus.com Subject: Re: Silently checking whether diagnostics would occur Date: Fri, 15 Sep 2000 11:25:00 -0000 Message-id: <200009151825.OAA18765@caip.rutgers.edu> X-SW-Source: 2000-09/msg00340.html > From: "Joseph S. Myers" > > > > 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