[ILUG] gcc and printf style functions

Brian Foster blf at blf.utvinternet.co.uk
Sat Mar 5 06:31:03 GMT 2005


  | Date: Fri, 4 Mar 2005 21:51:11 +0000
  | From: kevin lyda <kevin+dated+1110405085.510c82 at ie.suberic.net>
  | 
  | On Fri, Mar 04, 2005 at 07:27:59PM +0100, Brian Foster wrote:
  |  >  - is it possible, without changing gcc, to remove
  |  >    or redefine some of the % codes it does know?
  | 
  | i think it should be.  and i think the argument for it is that the
  | format escapes are actually handled by the target libc.  gcc seems to
  | know glibc and various versions of ansi/iso c.  but gcc targets platforms
  | with other libc's - the mingw gcc uses the ms libc.

 I concur, and in fact, that reasoning (albeit with
 different examples) _is_ why I asked, especially
 about the removing and/or redefining --- some of
 so-called `libc's I am(!) working with do not have
 some of the % codes or, in one case, a broken one
 (which I therefore want to avoid using).

  |  > it's never been too important, but if someone just
  |  > happens to know ....  thanks.
  | 
  | yes, but it's a great way to catch some silly errors.

 yep.  I first ran into this sort of checking with
 the similar `lint' directive /*PRINTFLIKEn*/ where
 <n> was the argument with the format string (the
 args to print were, AFAICR, assumed to be n+1 ...).

 I've been using this type of checking ever since
 (when possible)...

cheers!
	-blf-
-- 
Experienced (20+ yrs) kernel/software Eng: | Brian Foster   Montpellier,
 • Unix, embedded, &tc;  • Linux;  • doc;  | blf at utvinternet.ie   FRANCE
 • IDL, automated testing, process, &tc.   |  Stop E$$o (ExxonMobile)!
Résumé (CV) http://www.blf.utvinternet.ie  |     http://www.stopesso.com



More information about the ILUG mailing list