From: Paul Eggert <eggert@cs.ucla.edu>
To: noloader@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: Emacs 26.2 etags.c warning
Date: Fri, 3 May 2019 12:41:09 -0700 [thread overview]
Message-ID: <8097bd03-8fac-1b68-f1f2-4b3a3c9f3319@cs.ucla.edu> (raw)
In-Reply-To: <CAH8yC8mCg-SfdXadQcYaNj-DtjqDCL6gwWSvAhRtbe+HERuzDw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
On 5/3/19 7:50 AM, Jeffrey Walton wrote:
> etags.c:88: warning: "NDEBUG" redefined
> # define NDEBUG /* disable assert */
>
> Maybe guard the define?
That's already done in the Emacs master branch.
Come to think of it, the NDEBUG stuff in etags.c can be simplified to
avoid this mess entirely. I installed the attached into master to do that.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Simplify-use-of-NDEBUG-in-etags.c.patch --]
[-- Type: text/x-patch; name="0001-Simplify-use-of-NDEBUG-in-etags.c.patch", Size: 1448 bytes --]
From 0c672d2e3f11ae13ec35cc6c5615f745d233e686 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 3 May 2019 12:38:28 -0700
Subject: [PATCH] Simplify use of NDEBUG in etags.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lib-src/etags.c [!DEBUG]: Do not define NDEBUG,
as that’s conf_post.h’s job now.
[NDEBUG]: Do not redefine ‘assert’, as that works around
ancient bugs (e.g., sunos4 pcc) that don’t matter any more,
as can be seen that other Emacs source files that successfully
use assert.h without this workaround.
---
lib-src/etags.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 362897fb0c..949ab5a2c6 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -84,10 +84,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
# undef DEBUG
# define DEBUG true
#else
-# define DEBUG false
-# ifndef NDEBUG
-# define NDEBUG /* disable assert */
-# endif
+# define DEBUG false
#endif
#include <config.h>
@@ -131,11 +128,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
#include <c-strcase.h>
#include <assert.h>
-#ifdef NDEBUG
-# undef assert /* some systems have a buggy assert.h */
-# define assert(x) ((void) 0)
-#endif
-
#include <getopt.h>
#include <regex.h>
--
2.21.0
prev parent reply other threads:[~2019-05-03 19:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 14:50 Emacs 26.2 etags.c warning Jeffrey Walton
2019-05-03 19:41 ` Paul Eggert [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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8097bd03-8fac-1b68-f1f2-4b3a3c9f3319@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=noloader@gmail.com \
/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://git.savannah.gnu.org/cgit/emacs.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).