From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31143 invoked by alias); 1 May 2010 00:10:47 -0000 Received: (qmail 31122 invoked by uid 22791); 1 May 2010 00:10:45 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 May 2010 00:10:41 +0000 Received: (qmail 26519 invoked from network); 1 May 2010 00:10:39 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 May 2010 00:10:39 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: `sentinel' gcc-3.x/OpenBSD compat. [Re: [patch 1/3] Make obconcat use stdarg] Date: Sat, 01 May 2010 00:10:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: Jan Kratochvil , Mark Kettenis References: <20100430181605.GA19190@host0.dyn.jankratochvil.net> <201004301908.o3UJ8mGf006742@glazunov.sibelius.xs4all.nl> <20100430221839.GA21100@host0.dyn.jankratochvil.net> In-Reply-To: <20100430221839.GA21100@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005010110.37403.pedro@codesourcery.com> 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/msg00000.txt.bz2 First off, to be clear, I like the idea of the patch. I was going to mention the need for the cast as well, so, excuse me jumping in. On Friday 30 April 2010 23:18:39, Jan Kratochvil wrote: > 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) I sure have seen this with OpenBSD's 3.x.x compiler. You must be aware of libiberty's `concat', but have you seen src/include/ansidecl.h's ATTRIBUTE_SENTINEL? I don't understand why we reinvent these macros for this, given that one of the first things defs.h does is include ansidecl.h. E.g, defs.h has both ATTR_FORMAT which looks like could be replaced by ATTRIBUTE_PRINTF, and also has ATTR_NORETURN, which looks like could be replaced by ATTRIBUTE_NORETURN. We already use ATTRIBUTE_UNUSED in a lot of places. > OTOH a requirement of some special sentinel expression instead of simple `NULL' > for obconcat would nullify its stdarg convenience. I don't understand what you mean here. Why not just do what we do with `concat' to handle this (which is what the gcc manual says to do), that is, just write `(char *) NULL' instead of NULL for the sentinel, and be done with it. -- Pedro Alves