🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52609

Re: Can I make my functions work with -Wformat?

#52609
From: Gregory N. Bond
Date: Mon, 29 Jun 1992 00:54
22 lines
1620 bytes
>>>>> On Wed, 24 Jun 1992 10:34:51 GMT, gnb@duke.bby.oz.au (Gregory N. Bond) said:

Me> Is these some interface defined (probably a #pragma) than allows me to
Me> associate with a function declaration the checking of printf-type
Me> arguments that -Wformat does?

The answer was in the manual after all, under the section "Variable
Attributes" rather than "Function Attributes" (where I had already
looked).  This could be construed as a bug in the documentation!

Something like 
	extern int
	my_printf (void *my_object, const char *my_format, ...)
                  __attribute__ ((format (printf, 2, 3)));

will do the trick.  Thanks to Timothy J. Lee  <timlee@btr.com> for
pointing this out.

Greg.
--
Gregory Bond <gnb@bby.oz.au> Burdett Buckeridge & Young Ltd Melbourne Australia
"Take my archetypes - please!" - Henny Jungman (geoffm@purplehaze.Corp.Sun.COM)
Technical Details
Message-ID: <GNB.92Jun29105414@duke.bby.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!gnb
References: <1992Jun24.103451.4683@melba.bby.oz.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,870838bd4f6eeada
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-06-28 17:14:42 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!gnb
From: gnb@duke.bby.oz.au (Gregory N. Bond)
Newsgroups: gnu.gcc.help
Subject: Re: Can I make my functions work with -Wformat?
Message-ID: <GNB.92Jun29105414@duke.bby.oz.au>
Date: 29 Jun 92 00:54:14 GMT
References: <1992Jun24.103451.4683@melba.bby.oz.au>
Sender: usenet@melba.bby.oz.au (news READER id)
Organization: Burdett, Buckeridge & Young, Melbourne, Australia
Lines: 22
In-Reply-To: gnb@duke.bby.oz.au's message of Wed, 24 Jun 1992 10:34:51 GMT
Nntp-Posting-Host: duke