From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6476 invoked by alias); 2 May 2010 06:49:31 -0000 Received: (qmail 6468 invoked by uid 22791); 2 May 2010 06:49:30 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 May 2010 06:49:26 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o426nITJ017128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 May 2010 02:49:19 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o426nCt9017958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 May 2010 02:49:16 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o426nCUA028758; Sun, 2 May 2010 08:49:12 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o426nAir028757; Sun, 2 May 2010 08:49:10 +0200 Date: Sun, 02 May 2010 06:49:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org Subject: Re: `sentinel' gcc-3.x/OpenBSD compat. [Re: [patch 1/3] Make obconcat use stdarg] Message-ID: <20100502064910.GA28651@host0.dyn.jankratochvil.net> References: <20100430181605.GA19190@host0.dyn.jankratochvil.net> <201004301908.o3UJ8mGf006742@glazunov.sibelius.xs4all.nl> <20100430221839.GA21100@host0.dyn.jankratochvil.net> <83eihww3yg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83eihww3yg.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00007.txt.bz2 On Sat, 01 May 2010 08:06:47 +0200, Eli Zaretskii wrote: > > Date: Sat, 1 May 2010 00:18:39 +0200 > > From: Jan Kratochvil > > Cc: gdb-patches@sourceware.org > > > > > I'm afraid you'll need an explicit cast for the NULLs used as the > > > sentinel value, otherwise platforms that > > > > > > #define NULL 0L > > > > > > will generate warnings like: > > > > > > sentinel.c: In function 'foo': > > > sentinel.c:8: warning: missing sentinel in function call > > > > > > and with -Werror, that's not a good :(. > > > > Which platforms? > > DJGPP (a.k.a. GO32) is one. #include void f (int i, ...) __attribute__ ((__sentinel__)); void f (int i, ...) { } void g (void) { f (1, NULL); } On gcc442b.zip it works correctly. no warning: f (1, NULL); f (1, (void *)0); f (1, ((void *)0)); /* output by gcc -E */ warning: f (1, 0); f (1, 0L); Any other platform? Thanks, Jan