From patchwork Wed Apr 10 18:01:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Zi X-Patchwork-Id: 1922187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=afoqQkWT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VF9fz3FlVz1yY8 for ; Thu, 11 Apr 2024 04:03:20 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 6B86735354A5; Wed, 10 Apr 2024 20:03:09 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=afoqQkWT; dkim-atps=neutral Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by helium.openadk.org (Postfix) with ESMTPS id 599EF3520DA8 for ; Wed, 10 Apr 2024 20:02:51 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org From: Yao Zi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1712772169; bh=Cw2tAQauxQAUueCTUfHR4HqqG3a9fveyOWjThUMd8lQ=; h=From:To:Cc:Subject:Date; b=afoqQkWTX01wxU9lwBmM5mt1WlZaX/bHk9N6dRaN/Y32tBscc2C8OTUNoZU4fLejm EWSSNE/mubSP0kp+1W+cvBGIKFVdhNH7O5Im6fOZaqdBbImbwYkI1Ok2eD3G5KivuZ 8EpzHcDprhwZmGsAUxsAL41yFMqbAkJB+kyq8SGXDE5ToofIBpSPZkGVjE4GmaZfJd 7veTAnrXtA0ZpjRJ7RVF8KTaCx48L2o/t1JwKhru9PM96h+7fTgV+udk5AMDxEa+xY iR726OlhiwMmf7uUXeaafeuBRpPFxVXPXKvHjMkVan8d0cd/l9ky9D67GT8k1rY/8Q 6goNO2AjHWhiw== To: devel@uclibc-ng.org Date: Wed, 10 Apr 2024 18:01:53 +0000 Message-ID: <20240410180159.46938-1-ziyao@disroot.org> MIME-Version: 1.0 Message-ID-Hash: ULYNKJA2NTYTCXMAXRJXFUR7LGA7OBR6 X-Message-ID-Hash: ULYNKJA2NTYTCXMAXRJXFUR7LGA7OBR6 X-MailFrom: ziyao@disroot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Yao Zi X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] libuargp: restrict compatibility macros in argp.h only List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Macros __attribute__, __format__ and __printf__ are defined in argp.h for compatibility with ANSI and old gccs. But leaving them effective out of the scope of the header may break applications relying on these compiler attributes even with __STRICT_ANSI__ defined. So undef the macros after using. Reviewed-by: Petr Vorel --- include/argp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/argp.h b/include/argp.h index 8e8674296..1824c69d6 100644 --- a/include/argp.h +++ b/include/argp.h @@ -562,4 +562,14 @@ __NTH (__option_is_end (__const struct argp_option *__opt)) } #endif +#ifdef __attribute__ +# if __GNUC__ < 2 ||(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__) +# undef __attribute__ +# endif +# if __GNUC__ < 2 ||(__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__) +# undef __format__ +# undef __printf__ +# endif +#endif + #endif /* argp.h */