From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from integral2.. (unknown [125.163.245.210]) by gnuweeb.org (Postfix) with ESMTPSA id 1D9147F683; Thu, 26 May 2022 11:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1653565314; bh=y31585ZHqWztLj18b136MK54LOeONfVKdZZVCfd0GeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXRCWzPmdewqGwvdfRR5OUlNlmAgXgqQqRkE8bBGMORCaEl7QtpUWbwKCL/Fz1xAn EyoV7EjPD4S52KyDcE7gerd/P6mMeoxxW9ffFnYIqGxnb1PJ8s+GyddYhulfsP5H0g yp+IbzZSDVMq+s1ZvOcwVlCfYPEl9uvm4f7BWUMDcmOyXw0+dsx0wD1OkcaupraVJz qgOHTw/s4q2G+jdmaLhDDK2iPMYNqg7OQCECZ9YLjJMgz+uusNXVOzoCeGBF+FImS6 FJIJ3Trs331CVmOanNYplGTkfX7WPwmD/5huqbm+aZc+juyhm+GnmIYiAxho77l3gI obESsgmc5HHew== From: Ammar Faizi To: GNU/Weeb Mailing List Cc: Ammar Faizi , Nick Mathewson Subject: [PATCH tor v1 6/6] test/test_hs_descriptor: Don't invoke GCC warning when compiling with clang Date: Thu, 26 May 2022 18:41:30 +0700 Message-Id: <20220526114130.285353-7-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220526114130.285353-1-ammarfaizi2@gnuweeb.org> References: <20220526114130.285353-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Compiling with clang-15 yields the following errors: ``` src/test/test_hs_descriptor.c:36:1: error: pragma diagnostic pop could not pop, no matching push [-Werror,-Wunknown-pragmas] ENABLE_GCC_WARNING("-Woverlength-strings") ^ ./src/lib/cc/compat_compiler.h:104:11: note: expanded from macro 'ENABLE_GCC_WARNING' PRAGMA_DIAGNOSTIC_(pop) ^ ./src/lib/cc/compat_compiler.h:94:35: note: expanded from macro 'PRAGMA_DIAGNOSTIC_' # define PRAGMA_DIAGNOSTIC_(x) PRAGMA_(clang diagnostic x) ^ ./src/lib/cc/compat_compiler.h:92:22: note: expanded from macro 'PRAGMA_' # define PRAGMA_(x) _Pragma (#x) ^ :188:19: note: expanded from here clang diagnostic pop ^ 1 error generated. ``` Do not invoke `ENABLE_GCC_WARNING("-Woverlength-strings")` when we are compiling with clang. This issue was introduced by commit 3ce2304c6d03 ("Use new ENABLE/DISABLE_GCC_WARNING"). Cc: Nick Mathewson Signed-off-by: Ammar Faizi --- src/test/test_hs_descriptor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c index 469e3c39f9..4280b2be38 100644 --- a/src/test/test_hs_descriptor.c +++ b/src/test/test_hs_descriptor.c @@ -33,7 +33,10 @@ DISABLE_GCC_WARNING("-Woverlength-strings") * at large. */ #endif #include "test_hs_descriptor.inc" + +#ifndef __clang__ ENABLE_GCC_WARNING("-Woverlength-strings") +#endif /* Test certificate encoding put in a descriptor. */ static void -- Ammar Faizi