This is the mail archive of the
mailing list for the GCC project.
Re: Patch to allow retrieving a status from format checking functions
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to allow retrieving a status from format checking functions
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 18 Sep 2000 10:33:57 -0600
- cc: gcc-patches at gcc dot gnu dot org, amylaar at cygnus dot co dot uk, gdr at codesourcery dot com, jsm28 at cam dot ac dot uk, meissner at cygnus dot com
- Reply-To: law at cygnus dot com
In message <200009180414.AAA11516@caip.rutgers.edu>you write:
> Based on our recent discussions on the gcc list, WRT not using a
> global status variable and instead passing in a status ptr, I came up
> with the following patch to allow retrieving a pass/fail status from
> the printf format checking functions.
> At the moment all callers ignore the status which leaves the behavior
> of the compiler unchanged. I plan to make use of this eventually in a
> __builtin_printf routine which I will be submitting once this gets in.
> (My thought being: I don't want to attempt any optimizations on a
> printf call if it doesn't pass format checks.)
> The CVS tree won't bootstrap at the moment (regardless of my patch.)
> Once that's fixed I plan to bootstrap with this. Assuming no
> problems, okay to install?
> 2000-09-17 Kaveh R. Ghazi <firstname.lastname@example.org>
> * Makefile.in (c-common.o): Depend on diagnostic.h.
> * c-common.c: Include diagnostic.h.
> (tfaff): Delete.
> (status_warning): New function.
> (check_format_info, maybe_read_dollar_number, check_format_types,
> finish_dollar_format_checking, check_function_format): Accept a
> `status' parameter. All callers changed.
> * c-common.h (check_function_format): Accept a `status' parameter.
> * c-typeck.c: Update call to `check_function_format'.
> * cp-tree.h (check_function_format): Accept a `status' parameter.
> * call.c, typeck.c: Updates calls to `check_function_format'.
You need a comment for the new function status_warning.
In that comment you should indicate how the status variable is used.
Assuming it bootstraps and tests you should make the changes noted above
and install your patch.