From: Eric Wong <user@example.com>
To: mwrap-perl@80x24.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 2/4] workaround -DNDEBUG warnings
Date: Sat, 2 Nov 2019 10:40:18 +0000 [thread overview]
Message-ID: <20191102104020.30317-3-user@example.com> (raw)
In-Reply-To: <20191102104020.30317-1-user@example.com>
From: Eric Wong <e@80x24.org>
Perl defaults to building with -DNDEBUG, which causes unused
variable warnings to show up when we use -Wall in CCFLAGS.
---
Mwrap.xs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Mwrap.xs b/Mwrap.xs
index b81dfc0..8ce7b46 100644
--- a/Mwrap.xs
+++ b/Mwrap.xs
@@ -133,6 +133,9 @@ mutex_lock(pthread_mutex_t *m)
{
int err = pthread_mutex_lock(m);
assert(err == 0);
+#ifdef NDEBUG
+ (void)err; /* quiet gcc warning */
+#endif
}
static void
@@ -140,6 +143,9 @@ mutex_unlock(pthread_mutex_t *m)
{
int err = pthread_mutex_unlock(m);
assert(err == 0);
+#ifdef NDEBUG
+ (void)err; /* quiet gcc warning */
+#endif
}
#ifndef HAVE_MEMPCPY
next prev parent reply other threads:[~2019-11-02 10:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-02 10:40 [PATCH 0/4] build system fixes Eric Wong
2019-11-02 10:40 ` [PATCH 1/4] Makefile.PL: remove CCFLAGS overrides Eric Wong
2019-11-02 10:40 ` Eric Wong [this message]
2019-11-02 10:40 ` [PATCH 3/4] quiet uninitialized variable warnings Eric Wong
2019-11-02 10:40 ` [PATCH 4/4] avoid mixing declarations and code Eric Wong
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 \
--in-reply-to=20191102104020.30317-3-user@example.com \
--to=user@example.com \
--cc=e@80x24.org \
--cc=mwrap-perl@80x24.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mwrap-perl.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).