From patchwork Sun May 18 12:57:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Bilka X-Patchwork-Id: 1003 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id EF0E636007B for ; Sun, 18 May 2014 05:57:57 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id B59DB63CF9DB1; Sun, 18 May 2014 05:57:57 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 92F3063CF9D41 for ; Sun, 18 May 2014 05:57:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=S/lWCz7+4zDBZNE+ 8JmCuqUvIivcsW3i5rFScxE9VXyDvPbYPyP1M1D3dy3WJBmoxL+cIrfwYIOGYJS7 u6u4ofFHdMhISm4BiwgXoIfRP1dvLzduj7Y+XZa2vSB12/eoJF49jWeXFlat2u/i YuRtHz66a1CD2D0Gh9whCJK/h7Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=jSzGLQVsRZD2123QMWYTm9 bpbwE=; b=xKW+r5oUFBzTUiK5nJRhelpt3BLrtQLavMhnqFG1nntjVwwZjD3J5Y cZzoCqKZWkmmqA3NxoI9xMQwTSCAYWjYCF/9idMBqFUCG5tKFCztjxBHCVdUPwFd Ck2i7FUQgcV13tAcj5GCuPCMy7TG0a5nRgR759a6i1WYY1pFCFSqE= Received: (qmail 25964 invoked by alias); 18 May 2014 12:57:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 25906 invoked by uid 89); 18 May 2014 12:57:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_05, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Sun, 18 May 2014 14:57:43 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: aurelien@aurel32.net Cc: libc-alpha@sourceware.org Subject: [PATCH][BZ #16907] Do not disable __attribute__ when you include argp.h Message-ID: <20140518125743.GA11620@domone.podge> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in Hi, As written in bug report: " When is included first and thus __attribute__ is not defined, with -std=c90, c99 or c11, the __attribute__ is redefined as empty due to the following code: This might break headers included later, for example it breaks -D_FORTIFY_SOURCE=2 by not defining strcpy() correctly [1]. Besides some reformating, this code is more than 10 years old, and I don't know if there is still a reason to redefine __attribute__ that way. " So is there any reason to keep fragments of code below? As we use __attribute__ in stdio.h without checking gcc version I doubt that compiling with gcc would work. I did not checked that though. * argp/argp-fmtstream.h: Do not define __attribute__. * argp/argp.h: Likewise. diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h index 1ed2834..f3f82df 100644 --- a/argp/argp-fmtstream.h +++ b/argp/argp-fmtstream.h @@ -29,21 +29,6 @@ #include #include -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \ - defined __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \ - defined __STRICT_ANSI__ -# define __format__ format -# define __printf__ printf -# endif -#endif - #if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H) /* line_wrap_stream is available, so use that. */ #define ARGP_FMTSTREAM_USE_LINEWRAP diff --git a/argp/argp.h b/argp/argp.h index 0868228..c1072a3 100644 --- a/argp/argp.h +++ b/argp/argp.h @@ -35,21 +35,6 @@ # define __NTH(fct) fct __THROW #endif -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \ - defined __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \ - defined __STRICT_ANSI__ -# define __format__ format -# define __printf__ printf -# endif -#endif - /* GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". */ #ifndef __restrict