building with -DDEBUG=1 [was: next snapshot in preparation for m4 1.4.12]

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Tom G. Christensen on 8/30/2008 7:23 AM:

Thanks for your followups.  More responses in subsequent mails, but first,
an easy one:

>>  'env CFLAGS="-DDEBUG=1 -g" make -e'
>> (forcing lib/c-stack.c to be compiled with debugging).  From there, 'cd
>> tests && make check' (DEBUG impacts M4's build as well, which will
>> probably make m4 tests fail, but we are only interested in debugging why
>> tests/test-c-stack is failing).
>>
> The m4 build now fails but atleast the gnulib tests build and run.
> 
> source='input.c' object='input.o' libtool=no \
>         DEPDIR=.deps depmode=sgi /bin/ksh ../build-aux/depcomp \
>         cc    -I../lib -I../lib -I/usr/tgcware/include  -DDEBUG=1 -g -c input.c
> cfe: Error: input.c, line 1120: The number of arguments doesn't agree with the number in the declaration.
>    while ((t = next_token (&td)) != TOKEN_EOF)
>  -------------------------^
> make[2]: *** [input.o] Error 1
> make[2]: Leaving directory `/usr/people/tgc/buildpkg/m4/src/m4-1.4.11.42-864d/src'

Oops.  I guess I'd better cleanup building with -DDEBUG defined (make
check still fails because of extra output turned on, but at least the
build completes).  In general, the use of -DDEBUG is not intended for end
users, only for isolating problems, so it tends to bit-rot.  Committing
the following:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAki76RQACgkQ84KuGfSFAYDMTwCcDFjUCJDm2o9H6O4eC/J6+sFu
2SoAoKBhY6oCRGYkNL0QFFsdpr5SJzxu
=LrJr
-----END PGP SIGNATURE-----

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch375 (text/plain, 2.3 KB)
From c8c770396a227c4e5e1359134dde14cff681da20 Mon Sep 17 00:00:00 2001
From: Eric Blake <[email protected]>
Date: Mon, 1 Sep 2008 07:05:56 -0600
Subject: [PATCH] Fix building with -DDEBUG=1.

* src/input.c (lex_debug) [DEBUG_INPUT]: Fix compilation failure.
* src/symtab.c (symtab_debug) [DEBUG_SYM]: Likewise.
* src/m4.c (includes) [DEBUG_STKOVF]: Likewise.
Reported by Tom G. Christensen.

Signed-off-by: Eric Blake <[email protected]>
---
 ChangeLog    |    8 ++++++++
 src/input.c  |    4 ++--
 src/m4.c     |    4 ++++
 src/symtab.c |    6 +++---
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25a15d9..7ffd356 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-01  Eric Blake  <[email protected]>
+
+	Fix building with -DDEBUG=1.
+	* src/input.c (lex_debug) [DEBUG_INPUT]: Fix compilation failure.
+	* src/symtab.c (symtab_debug) [DEBUG_SYM]: Likewise.
+	* src/m4.c (includes) [DEBUG_STKOVF]: Likewise.
+	Reported by Tom G. Christensen.
+
 2008-09-01  Ralf Wildenhues  <[email protected]>
 
 	Typos in source code comments.
diff --git a/src/input.c b/src/input.c
index 74b5f3f..a9471dc 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1117,7 +1117,7 @@ lex_debug (void)
   token_type t;
   token_data td;
 
-  while ((t = next_token (&td)) != TOKEN_EOF)
+  while ((t = next_token (&td, NULL)) != TOKEN_EOF)
     print_token ("lex", t, &td);
 }
-#endif
+#endif /* DEBUG_INPUT */
diff --git a/src/m4.c b/src/m4.c
index e1f5bb0..ee0fe8a 100644
--- a/src/m4.c
+++ b/src/m4.c
@@ -29,6 +29,10 @@
 #include "progname.h"
 #include "version-etc.h"
 
+#ifdef DEBUG_STKOVF
+# include "assert.h"
+#endif
+
 #define AUTHORS "Rene' Seindal"
 
 static void usage (int);
diff --git a/src/symtab.c b/src/symtab.c
index 872cfaa..b755790 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2003, 2006, 2007 Free
-   Software Foundation, Inc.
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2003, 2006, 2007,
+   2008 Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -357,7 +357,7 @@ symtab_debug (void)
   int delete;
   static int i;
 
-  while (next_token (&td) == TOKEN_WORD)
+  while (next_token (&td, NULL) == TOKEN_WORD)
     {
       text = TOKEN_DATA_TEXT (&td);
       if (*text == '_')
-- 
1.6.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.