m4-patches
[Top][All Lists]
Advanced

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

Re: FYI: 28-gary-sanitise-header-includes


From: Eric Blake
Subject: Re: FYI: 28-gary-sanitise-header-includes
Date: Wed, 4 Apr 2007 22:58:41 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Gary V. Vaughan <gary <at> gnu.org> writes:

> 
> 
> Applied to HEAD, after 4 days without comment.
> 
>   Index: ChangeLog
>   from  Gary V. Vaughan  <gary <at> gnu.org>
>       M4 was designed to have a small number of header files defining
>       the interfaces to several source files each.  Keeping this in
>       mind allows us to tidy things up considerably.  Having done this,
>       it becomes clear that some of the installed headers reference
>       other headers which are not installed (but that's another patch):
> 
>       * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
>       ...to here, so client modules can benefit too.
>       (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
>       lowest level to save doing it multiple times elsewhere.
...
>       * m4/path.c (config.h, stdlib.h): Ditto.

Oops.  This broke non-debug builds.  Sorry for not catching it sooner.

$ ./config.status --version
GNU M4 config.status 1.9a
configured by ./configure, generated by GNU Autoconf 2.61b,
  with options "'-C' 'CFLAGS=-ggdb -Wall' '--disable-assert' '--disable-nls' '--
enable-ltdl-convenience'"

ERROR: All 154 tests were run,
153 failed (2 expected failures).
## -------------------------- ##
## testsuite.log was created. ##
## -------------------------- ##

$ cat tests/testsuite.dir/001/testsuite.log
#                             -*- compilation -*-
1. macros.at:29: testing ...
./macros.at:59: m4 -b -d input.m4 < /dev/null
stderr:
m4:input.m4:5: Warning: define: extra arguments ignored: 3 > 2
m4:input.m4:10: Warning: defun: extra arguments ignored: 3 > 2
assertion "NODE_KEY (node) == NULL" failed: file "m4/hash.c", line 234
/home/eblake/m4-head/tests/testsuite: line 1391: 10548 Aborted                 (
core dumped) m4 -b -d input.m4 < /dev/null
./macros.at:59: exit code was 134, expected 0
1. macros.at:29: 1. Arity and defn (macros.at:29): FAILED (macros.at:59)

Cool - './configure --disable-assert' disables assertions, and yet we core 
dumped on an assertion failure! :)

I tracked the problem to the fact that hash.c was now compiled in such a way 
that <assert.h> was picked up prior to <config.h>, so assertions remained 
enabled; but then several slower preconditions are protected by NDEBUG, and got 
omitted; leading to a crash every time.

I am currently playing with a patch that follows gnulib policy of removing 
<config.h> from all .h, and making sure that it is the first line of all .c; 
hopefully that will clean up the problem.  Everything else may be factor-able 
into system_.h, but <config.h> must be handled specially if m4 source code is 
to see a consistent state.

-- 
Eric Blake







reply via email to

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