unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs 26.2 etags.c warning
@ 2019-05-03 14:50 Jeffrey Walton
  2019-05-03 19:41 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey Walton @ 2019-05-03 14:50 UTC (permalink / raw)
  To: emacs-devel

Hi Everyone,

I'm building Emacs 26.2 from sources. I use '-DNDEBUG -g2 -O3' as my
base CFLAGS. It is producing a warning when compiling etags.c.

gcc     -I. -I../src -I../lib -I. -I./../src -I./../lib
-L/usr/local/lib64 -Wl,-R,/usr/local/lib64 -Wl,--enable-new-dtags
-I/usr/local/include -DNDEBUG -g2 -O2 -march=native -fPIC
-DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"26.2\"" -o etags etags.c
regex.o  ../lib/libgnu.a
etags.c:88: warning: "NDEBUG" redefined
 #  define NDEBUG  /* disable assert */

Maybe guard the define?

Hat tip for building a release version of the software out of the box.

Jeff



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Emacs 26.2 etags.c warning
  2019-05-03 14:50 Emacs 26.2 etags.c warning Jeffrey Walton
@ 2019-05-03 19:41 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2019-05-03 19:41 UTC (permalink / raw)
  To: noloader; +Cc: emacs-devel

[-- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-03 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 14:50 Emacs 26.2 etags.c warning Jeffrey Walton
2019-05-03 19:41 ` Paul Eggert

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).