public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: GNU/Weeb Mailing List <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Nick Mathewson <[email protected]>
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	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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)
                       ^
  <scratch space>: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 <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
 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


      parent reply	other threads:[~2022-05-26 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 11:41 [GIT PULL tor v1 0/6] Build fixes for clang-15 Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 1/6] channel: Fix clang-15 complaint (unused variable) Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 2/6] connection_or: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 3/6] routerlist: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 4/6] compat_libevent: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 5/6] test/bench: " Ammar Faizi
2022-05-26 11:41 ` Ammar Faizi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox