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

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

According to Gary V. Vaughan on 4/5/2007 5:49 AM:
> Hi Eric,

Hi Gary,

> 
>> 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.
> 
> Okay, I'll stop futzing with my header install patch until you've finished
> that.

Sure enough, this solved './configure --disable-assert' builds.  I'm
checking this in:

2007-04-07  Eric Blake  <[email protected]>

	Include <config.h> first in all C files, and not in headers.
	Fixes regression for --disable-assert builds from 2007-04-02.
	* src/m4.h (includes): Don't include config.h here.
	* m4/m4private.h (includes): Likewise.
	* m4/builtin.c: Include config.h before anything else.
	* m4/debug.c: Likewise.
	* m4/hash.c: Likewise.
	* m4/input.c: Likewise.
	* m4/m4.c: Likewise.
	* m4/macro.c: Likewise.
	* m4/module.c: Likewise.
	* m4/symtab.c: Likewise.
	* m4/syntax.c: Likewise.
	* m4/utility.c: Likewise.
	* src/freeze.c: Likewise.
	* src/stackovf.c: Likewise.

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

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

iD8DBQFGGHhY84KuGfSFAYARAnF+AJ47QRToJ8wRvT3qnZbWGgDLRhneyACeNU5V
7IOxI3g7NjxXmQKwQontHbU=
=0Qey
-----END PGP SIGNATURE-----

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch254 (text/plain, 7.1 KB)
Index: m4/builtin.c
===================================================================
RCS file: /sources/m4/m4/m4/builtin.c,v
retrieving revision 1.26
diff -u -p -r1.26 builtin.c
--- m4/builtin.c	27 Oct 2006 17:03:51 -0000	1.26
+++ m4/builtin.c	8 Apr 2007 05:00:49 -0000
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor
    Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2005,
-   2006 Free Software Foundation, Inc.
+   2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
 /* Code for all builtin macros, initialisation of symbol table, and
    expansion of user defined macros.  */
 
+#include <config.h>
+
 #include "m4private.h"
 
 /* Find the builtin which has NAME.  If HANDLE is not NULL, then
Index: m4/debug.c
===================================================================
RCS file: /sources/m4/m4/m4/debug.c,v
retrieving revision 1.30
diff -u -p -r1.30 debug.c
--- m4/debug.c	2 Apr 2007 12:06:23 -0000	1.30
+++ m4/debug.c	8 Apr 2007 05:00:49 -0000
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 1991, 1992, 1993, 1994, 2006.
-                 2007 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1993, 1994, 2006, 2007 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include <sys/stat.h>
 #include <stdarg.h>
 
Index: m4/hash.c
===================================================================
RCS file: /sources/m4/m4/m4/hash.c,v
retrieving revision 1.20
diff -u -p -r1.20 hash.c
--- m4/hash.c	1 Sep 2006 23:11:05 -0000	1.20
+++ m4/hash.c	8 Apr 2007 05:00:49 -0000
@@ -1,5 +1,5 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 2001, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
    Written by Gary V. Vaughan <[email protected]>
 
    This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,8 @@
    - Implement the macroized magic values with the API.
  */
 
+#include <config.h>
+
 #include "hash.h"
 #include "m4private.h"
 
Index: m4/input.c
===================================================================
RCS file: /sources/m4/m4/m4/input.c,v
retrieving revision 1.64
diff -u -p -r1.64 input.c
--- m4/input.c	2 Apr 2007 12:28:08 -0000	1.64
+++ m4/input.c	8 Apr 2007 05:00:50 -0000
@@ -20,6 +20,8 @@
 
 /* Handling of different input sources, and lexical analysis.  */
 
+#include <config.h>
+
 #include "m4private.h"
 
 /* Define this to see runtime debug info.  Implied by DEBUG.  */
Index: m4/m4.c
===================================================================
RCS file: /sources/m4/m4/m4/m4.c,v
retrieving revision 1.21
diff -u -p -r1.21 m4.c
--- m4/m4.c	6 Oct 2006 13:13:15 -0000	1.21
+++ m4/m4.c	8 Apr 2007 05:00:50 -0000
@@ -1,5 +1,5 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001, 2004, 2006
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001, 2004, 2006, 2007
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include "m4private.h"
 
 #define DEFAULT_NESTING_LIMIT	1024
Index: m4/m4private.h
===================================================================
RCS file: /sources/m4/m4/m4/m4private.h,v
retrieving revision 1.78
diff -u -p -r1.78 m4private.h
--- m4/m4private.h	2 Apr 2007 12:06:23 -0000	1.78
+++ m4/m4private.h	8 Apr 2007 05:00:50 -0000
@@ -22,8 +22,6 @@
 #ifndef M4PRIVATE_H
 #define M4PRIVATE_H 1
 
-#include <config.h>
-
 #include <m4/m4module.h>
 
 #include "cloexec.h"
Index: m4/macro.c
===================================================================
RCS file: /sources/m4/m4/m4/macro.c,v
retrieving revision 1.66
diff -u -p -r1.66 macro.c
--- m4/macro.c	3 Apr 2007 11:38:01 -0000	1.66
+++ m4/macro.c	8 Apr 2007 05:00:50 -0000
@@ -21,6 +21,8 @@
 /* This file contains the functions that perform the basic argument
    parsing and macro expansion.  */
 
+#include <config.h>
+
 #include <stdarg.h>
 
 #include "m4private.h"
Index: m4/module.c
===================================================================
RCS file: /sources/m4/m4/m4/module.c,v
retrieving revision 1.49
diff -u -p -r1.49 module.c
--- m4/module.c	2 Apr 2007 12:06:23 -0000	1.49
+++ m4/module.c	8 Apr 2007 05:00:50 -0000
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include "configmake.h"
 #include "m4private.h"
 #include "xvasprintf.h"
Index: m4/symtab.c
===================================================================
RCS file: /sources/m4/m4/m4/symtab.c,v
retrieving revision 1.71
diff -u -p -r1.71 symtab.c
--- m4/symtab.c	28 Feb 2007 21:31:12 -0000	1.71
+++ m4/symtab.c	8 Apr 2007 05:00:50 -0000
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include "m4private.h"
 
 /* Define this to see runtime debug info.  Implied by DEBUG.  */
Index: m4/syntax.c
===================================================================
RCS file: /sources/m4/m4/m4/syntax.c,v
retrieving revision 1.21
diff -u -p -r1.21 syntax.c
--- m4/syntax.c	23 Jan 2007 14:28:22 -0000	1.21
+++ m4/syntax.c	8 Apr 2007 05:00:50 -0000
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include "m4private.h"
 
 /* Define this to see runtime debug info.  Implied by DEBUG.  */
Index: m4/utility.c
===================================================================
RCS file: /sources/m4/m4/m4/utility.c,v
retrieving revision 1.58
diff -u -p -r1.58 utility.c
--- m4/utility.c	2 Apr 2007 12:06:23 -0000	1.58
+++ m4/utility.c	8 Apr 2007 05:00:50 -0000
@@ -18,6 +18,8 @@
    02110-1301  USA
 */
 
+#include <config.h>
+
 #include "m4private.h"
 
 #include "exitfail.h"
Index: src/freeze.c
===================================================================
RCS file: /sources/m4/m4/src/freeze.c,v
retrieving revision 1.64
diff -u -p -r1.64 freeze.c
--- src/freeze.c	3 Apr 2007 11:38:01 -0000	1.64
+++ src/freeze.c	8 Apr 2007 05:00:50 -0000
@@ -20,6 +20,8 @@
 
 /* This module handles frozen files.  */
 
+#include <config.h>
+
 #include "m4.h"
 
 #include "binary-io.h"
Index: src/m4.h
===================================================================
RCS file: /sources/m4/m4/src/m4.h,v
retrieving revision 1.24
diff -u -p -r1.24 m4.h
--- src/m4.h	2 Apr 2007 12:06:23 -0000	1.24
+++ src/m4.h	8 Apr 2007 05:00:50 -0000
@@ -21,8 +21,6 @@
 #ifndef M4_H
 #define M4_H
 
-#include <config.h>
-
 #include <signal.h>
 
 #include "m4private.h"
Index: src/stackovf.c
===================================================================
RCS file: /sources/m4/m4/src/stackovf.c,v
retrieving revision 1.22
diff -u -p -r1.22 stackovf.c
--- src/stackovf.c	2 Apr 2007 12:06:23 -0000	1.22
+++ src/stackovf.c	8 Apr 2007 05:00:50 -0000
@@ -78,6 +78,8 @@
 /* Define this to see runtime debug info.  Implied by DEBUG.  */
 /*#define DEBUG_STKOVF */
 
+#include <config.h>
+
 #include "m4.h"
 
 #ifdef USE_STACKOVF
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.