From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <539b509a0687ab7f0086c14be1187539@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] x11-init.c From: Charles Forsyth Date: Wed, 23 Jun 2004 10:07:04 +0100 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-frhuphsbisybgaffzbugmreumv" Topicbox-Message-UUID: aa88f876-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-frhuphsbisybgaffzbugmreumv Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit gcc enables the warnings with -Wformat, but the association between varargs function and format checking is done by the following (on FreeBSD): int asprintf __P((char **, const char *, ...)) __printflike(2, 3); where #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) it's the __attribute__ cluster that's built-in to gcc. Linux uses different #defines but the result is similar. hence the need for ifdefs somewhere to avoid feeding __stuff__ to other compilers. (there are many many more __things__.) the list of formats is also built-in to the compiler. it doesn't look as though it can easily be extended, but i have waded through neither code nor spent time down by the docs. Plan 9's compilers use a pragma to allow sets of format types and flags to be defined outside the compiler, in a way that doesn't give other compilers heartburn, and thus without absolutely requiring ifdefs. to be fair, the current implementation assumes all flags (in the current scope) have the same meaning, and does define a handful of built-in flags such as '.' (although neither restriction is essential); 375 lines. --upas-frhuphsbisybgaffzbugmreumv Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Wed Jun 23 09:51:19 BST 2004 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 4D32F1A06B for ; Wed, 23 Jun 2004 04:49:56 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (neuromancer.cse.psu.edu [130.203.4.2]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 49B8519C87 for <9fans@cse.psu.edu>; Wed, 23 Jun 2004 04:49:44 -0400 (EDT) Received: from mail.cse.psu.edu ([130.203.4.6]) by localhost (neuromancer [130.203.4.2]) (amavisd-new, port 10024) with LMTP id 03195-01-22 for <9fans@cse.psu.edu>; Wed, 23 Jun 2004 04:49:43 -0400 (EDT) Received: from mercury.bath.ac.uk (mercury.bath.ac.uk [138.38.32.81]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id E195019C72 for <9fans@cse.psu.edu>; Wed, 23 Jun 2004 04:49:42 -0400 (EDT) Received: from news by mercury.bath.ac.uk with local (Exim 3.12 #1) id 1Bd3RH-0007B9-00 for 9fans@cse.psu.edu; Wed, 23 Jun 2004 09:49:03 +0100 Received: from GATEWAY by bath.ac.uk with netnews for 9fans@cse.psu.edu (9fans@cse.psu.edu) To: 9fans@cse.psu.edu Date: Wed, 23 Jun 2004 08:47:20 GMT From: Bengt Kleberg Message-ID: Organization: Ericsson Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit References: <34411952-C49C-11D8-9BEC-000A9599CA60@google.com>, <20040623012317.5480.qmail@g.galapagos.bx.psu.edu> Subject: Re: [9fans] x11-init.c X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Scott Schwartz wrote: ...deleted > Gcc has a way to tell the compiler to check printf like varargs functions. > Given the impact, maybe the ports should use that, at the cost of some ifdefs. i hope this means that gcc should get some additional flags. it would be unfortunate if it means that the ports should be made dependent upon gcc. bengt --upas-frhuphsbisybgaffzbugmreumv--