From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31582 invoked by alias); 30 Apr 2010 22:18:53 -0000 Received: (qmail 31569 invoked by uid 22791); 30 Apr 2010 22:18:50 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_QE,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; Fri, 30 Apr 2010 22:18:45 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3UMIg71001617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Apr 2010 18:18:42 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3UMIeJR011309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Apr 2010 18:18:42 -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 o3UMIdRi021993; Sat, 1 May 2010 00:18:39 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o3UMIdb7021992; Sat, 1 May 2010 00:18:39 +0200 Date: Fri, 30 Apr 2010 22:18:00 -0000 From: Jan Kratochvil To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: `sentinel' gcc-3.x/OpenBSD compat. [Re: [patch 1/3] Make obconcat use stdarg] Message-ID: <20100430221839.GA21100@host0.dyn.jankratochvil.net> References: <20100430181605.GA19190@host0.dyn.jankratochvil.net> <201004301908.o3UJ8mGf006742@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004301908.o3UJ8mGf006742@glazunov.sibelius.xs4all.nl> 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-04/txt/msg01022.txt.bz2 On Fri, 30 Apr 2010 21:08:48 +0200, Mark Kettenis wrote: > > From: Jan Kratochvil > > > > __attribute__ ((sentinel)) availability for gcc >= 4.0 I have copied from > > . It roughly matches the GCC ChangeLog dates. > > The OpenBSD system compile, which is based on GCC 3.3.5, already has > the sentinel attribute. FSF GCC 3.3.5 does not support this attribute: void f (int i, ...) __attribute__ ((__sentinel__)); sentinel.c:1: warning: `__sentinel__' attribute directive ignored (+ there are no traces of any `sentinel' in the gcc-3.3.5 sources) OpenBSD-4.6-amd64 from md5sum 28edaa65b16bd5381ebf645d27039a94 openbsd-install46.iso does not boot for me on Fedora 12 x86_64 KVM using kernel-2.6.32.11-99.fc12.x86_64 qemu-system-x86-0.11.0-13.fc12.x86_64 as it hangs on "setting tty flags"; I have not found any OpenBSD Live image. Moreover I do not consider relevant to support this attribute on so obsolete compiler. Not using the attribute has no effect on users building GDB. This attribute is useful only for the GDB developers. > 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? Could you provide a login there? As NULL is commonly defined using (such as in ): #ifndef NULL # ifdef __cplusplus # define NULL (0L) # else /* !__cplusplus */ # define NULL ((void*) 0) # endif /* !__cplusplus */ #endif forcing NULL to be ((void *) 0) may make GDB C++ compatibility problematic (I do not understand reasons for the conditional above, though). OTOH a requirement of some special sentinel expression instead of simple `NULL' for obconcat would nullify its stdarg convenience. Therefore something could be placed to configure.ac for NULL redefinition depending on the test on the specific build system. Thanks, Jan