m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: building with -DDEBUG=1 [was: next snapshot in preparation for m4 1.4.12]
Date: Mon, 01 Sep 2008 07:07:32 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----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             address@hidden
-----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-----
>From c8c770396a227c4e5e1359134dde14cff681da20 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
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 <address@hidden>
---
 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  <address@hidden>
+
+       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  <address@hidden>
 
        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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]