From patchwork Sun May 5 11:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlef Riekenberg X-Patchwork-Id: 1931482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=lists.linux.it header.i=@lists.linux.it header.a=rsa-sha256 header.s=picard header.b=o0+lAHoN; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=web.de header.i=wine.dev@web.de header.a=rsa-sha256 header.s=s29768273 header.b=SqTqERte; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (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 4VXMBq3NMlz1xnS for ; Sun, 5 May 2024 21:05:04 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.linux.it; i=@lists.linux.it; q=dns/txt; s=picard; t=1714907093; h=mime-version : message-id : to : date : subject : list-id : list-unsubscribe : list-archive : list-post : list-help : list-subscribe : from : reply-to : content-type : content-transfer-encoding : sender : from; bh=qtbZheEEQq251QUHamaIFo9bBQvIvp7HVhtejhkwC9A=; b=o0+lAHoNvTa3DIgAKzMgk8xmLffbIcasH+eTiLCfJTS/E75MbAolZLNBy0hGc3F11r8Om nucYd8+AwbcvJQB8q0o9hlUoxSx1YYdTWYRfIEBijOZB8zAI9uKBXBlN7YuMP9AZIiFhODF l1d6ACs2JD9vcqwMwezpYcl0Uku3Uqg= Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 52CAF3CD8E0 for ; Sun, 5 May 2024 13:04:53 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 2B50D3CD657 for ; Sun, 5 May 2024 13:04:49 +0200 (CEST) Authentication-Results: in-4.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=web.de (client-ip=212.227.15.3; helo=mout.web.de; envelope-from=wine.dev@web.de; receiver=lists.linux.it) Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 4D1D410060B4 for ; Sun, 5 May 2024 13:04:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1714907088; x=1715511888; i=wine.dev@web.de; bh=/9YjdNIZsshtrUFCxlMGz9sbm5RmFY8Nyh9wYJOzCSA=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Subject: Content-Type:Date:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=SqTqERtelHqV27yai/NyCi/qdIMx5poWZun2ehRAeTCk5jNpqz+NMEr1OT7MW1kC XxD4yqiWZ/+kQvi5IN5G0xddNQqpS5EEp9AlOyqC06PDFmES5lia2MZxd1SyROasE mzmj6IbaIQZ9FsA2+X1rxjYi7QiFyZMBSMIHvNEYz06rYQL7EuePU6HwabLRIN+ZQ MLY9YLvqBUhkdnkjJBPMgAYVGMMA+dhKiHMDzR1OC0QXiXQDOdUGiBHLPf9iGmihq GADYySoAElT9X3Q2IvX8plLYOcojSGHMJqndORb2AqMudLzKi8k5poXsYaelg83IR eAqvYDs+pYMEF7pQFQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [79.232.214.172] ([79.232.214.172]) by web-mail.web.de (3c-app-webde-bs13.server.lan [172.19.170.13]) (via HTTP); Sun, 5 May 2024 13:04:48 +0200 MIME-Version: 1.0 Message-ID: To: ltp@lists.linux.it Date: Sun, 5 May 2024 13:04:48 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:CcOUwexgMPufAAQ+fXe0c0IVsl3BVTH8/Vau3e8GYKq7GbMthhlT0ThV6NpB87UEXIFM0 9fMv5WQPUjSy2cK/wrT1AgbrA3xT6EPf9hWZqI5ryRbkVcc+THRVewKnbnN4989+gShFrZqufsFZ zfe7feD8RSQZtwWarBO1dnup6vIz3ddKNynhiohaako2qjOgeRdChPAlGjpu91/afkNFrPB5UAVc /LKA1kd6/AayN+kG0zHjdMmBe++ABmTXSQ1quR05bQaUBNcPvAxUffXKb4Mq7f9PAHQGQ7X4oH+0 Sg= UI-OutboundReport: notjunk:1;M01:P0:5jS6culgZzo=;Y2OlPZLOMdcZ1e6jFj4i+jCgbQb ZeHG3kOxjFSfllcGiW2T1opWaQ13YNsYPIHvNO7T+QHLIrFkKxkZhFeqhRZzxdx7WYOxY+TMX XfiFM2SZEj0ciyfvtHKvIiZPCdEGqJuSNRZFPjAMdCnWVmRDmFuCOsVoRhOjx08ZNpwcFY6J4 iqNS4Vf431Kv9wKcBM78RkVIPRMgRxScJapGqbFi2Grdr6cfN7GGDNInnnrM8V6PCTyYWBJAP of/+TUzbSCZJUOA06SZFakZMAry6Qxuvs9vOUd5btUYnpFnMa8F8zxeAExgAvj5+L2U1sQU6Z HN2veS4oAXbRTIybz9eII144Lle4siJFpAffdC77CrFoBWbEmtfvd7aVS2PZPhldtHXVV39sO oI+tdXs2JCkjO0En/hMHdhe9O6lSplMiThqogfeyiwtq2ugHUmn1EOLco83lQHyJLNqkCPsPR aP1VyvmqgJ86DcvjaxfY1DI+5wKyjKp3k4KwJ6KruGPjT4JxmoGbFkazhBFY4FRwSqLC28EPr o+bS7U+UhwJba9yPiAFNJwFi3qp8laR7mxSUYvcqTT+lIMX38FsEWtCF/UR6AukTNwedXVhEH KojJcztfctViwyVblCP9Zq/d1JkCEZ6I0HANRlg7Ot6AbMeLhhVdnuGNoyZa1bplGx2oZIHg9 QeE8y+5BncXlwmLT+QPPAGjuXtuuiLHSVZX5V16u75D2tmxBDR9gwk7+e4L9Fdw= X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH] open_posix_testsuite: Avoid non portable GCC extensions without a guard X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Detlef Riekenberg via ltp From: Detlef Riekenberg Reply-To: Detlef Riekenberg Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The GCC extension "__attribute__" breaks other compiler and produces 458 test failures. --- Regards ... Detlef Signed-off-by: Detlef Riekenberg --- .../open_posix_testsuite/include/posixtest.h | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) -- 2.40.1 diff --git a/testcases/open_posix_testsuite/include/posixtest.h b/testcases/open_posix_testsuite/include/posixtest.h index d1b298488..07979b736 100644 --- a/testcases/open_posix_testsuite/include/posixtest.h +++ b/testcases/open_posix_testsuite/include/posixtest.h @@ -20,9 +20,30 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) #endif -#define PTS_ATTRIBUTE_NORETURN __attribute__((noreturn)) -#define PTS_ATTRIBUTE_UNUSED __attribute__((unused)) -#define PTS_ATTRIBUTE_UNUSED_RESULT __attribute__((warn_unused_result)) +/* __attribute__ is a non portable gcc extension */ +/* TODO: Add support for C23 attributes */ +#if defined __has_attribute +# if __has_attribute(noreturn) +# define PTS_ATTRIBUTE_NORETURN __attribute__((noreturn)) +# endif +# if __has_attribute(unused) +# define PTS_ATTRIBUTE_UNUSED __attribute__((unused)) +# endif +# if __has_attribute(warn_unused_result) +# define PTS_ATTRIBUTE_UNUSED_RESULT __attribute__((warn_unused_result)) +# endif +#endif + +#ifndef PTS_ATTRIBUTE_NORETURN +#define PTS_ATTRIBUTE_NORETURN +#endif +#ifndef PTS_ATTRIBUTE_UNUSED +#define PTS_ATTRIBUTE_UNUSED +#endif +#ifndef PTS_ATTRIBUTE_UNUSED_RESULT +#define PTS_ATTRIBUTE_UNUSED_RESULT +#endif + #define PTS_WRITE_MSG(msg) do { \ if (write(STDOUT_FILENO, msg, sizeof(msg) - 1)) { \