From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17417 invoked by alias); 12 Nov 2003 11:10:31 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 17410 invoked from network); 12 Nov 2003 11:10:30 -0000 Received: from unknown (HELO mx5.informatik.uni-tuebingen.de) (134.2.12.32) by sources.redhat.com with SMTP; 12 Nov 2003 11:10:30 -0000 Received: from localhost (loopback [127.0.0.1]) by mx5.informatik.uni-tuebingen.de (Postfix) with ESMTP id 7C61D11A; Wed, 12 Nov 2003 12:10:29 +0100 (NFT) Received: from mx3.informatik.uni-tuebingen.de ([134.2.12.26]) by localhost (mx5 [134.2.12.32]) (amavisd-new, port 10024) with ESMTP id 39224-04; Wed, 12 Nov 2003 12:10:27 +0100 (MET) Received: from juist (semeai [134.2.15.66]) by mx3.informatik.uni-tuebingen.de (Postfix) with ESMTP id 82F99144; Wed, 12 Nov 2003 12:10:27 +0100 (NFT) Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 1AJstG-00008X-00; Wed, 12 Nov 2003 12:10:26 +0100 To: "Bo Do" Cc: Subject: Re: Use -Wformat for own functions? References: <00a901c3a90d$86c2fae0$2bfb0ec2@flygp.se> From: Falk Hueffner Date: Wed, 12 Nov 2003 11:10:00 -0000 In-Reply-To: <00a901c3a90d$86c2fae0$2bfb0ec2@flygp.se> Message-ID: <873cctetb1.fsf@student.uni-tuebingen.de> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (cabbage) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (McAfee AntiVirus) at informatik.uni-tuebingen.de X-SW-Source: 2003-11/txt/msg00163.txt.bz2 "Bo Do" writes: > I've written my own version of sprintf: > my_sprintf(MyBuffer, const char *format, ...) > I wonder if there's a way to use -Wformat, or any functionality of > the compiler, to make sure that the number of arguments supplied > (the ... ) are correct and have types appropriate to the format > string specified. Yes. Check __attribute__((printf)). -- Falk