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]

Re: Patch to allow retrieving a status from format checking functions



  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?
  > 
  > 		Thanks,
  > 		--Kaveh
  > 
  > 
  > 2000-09-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
  > 
  > 	* 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:
  > 	* 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.

Thanks,
jeff


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