Work around portability problem on Solaris 10: flex-generated

files include <stdio.h> before <config.h>, which messes up
because the latter defines __EXTENSIONS__.  Address the problem
by creating two new little files that include <config.h> first,
then include the flex-generated files.  Rewrite everyone else
to include <config.h> first, as well.
* lib/timevar.c: Always include "config.h".
* src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
(EXTRA_bison_SOURCES): New macro.
* src/scan-gram-c.c, src/scan-skel-c.c: New files.
* src/system.h: Don't include config.h.
* src/LR0.c: Include <config.h> first.
* src/assoc.c: Likewise.
* src/closure.c: Likewise.
* src/complain.c: Likewise.
* src/conflicts.c: Likewise.
* src/derives.c: Likewise.
* src/files.c: Likewise.
* src/getargs.c: Likewise.
* src/gram.c: Likewise.
* src/lalr.c: Likewise.
* src/location.c: Likewise.
* src/main.c: Likewise.
* src/muscle_tab.c: Likewise.
* src/nullable.c: Likewise.
* src/output.c: Likewise.
* src/parse-gram.y: Likewise.
* src/print.c: Likewise.
* src/print_graph.c: Likewise.
* src/reader.c: Likewise.
* src/reduce.c: Likewise.
* src/relation.c: Likewise.
* src/state.c: Likewise.
* src/symlist.c: Likewise.
* src/symtab.c: Likewise.
* src/tables.c: Likewise.
* src/uniqstr.c: Likewise.
* src/vcg.c: Likewise.
This commit is contained in:
Paul Eggert
2005-12-09 23:51:26 +00:00
parent 7029f8927f
commit 2cec9080f6
31 changed files with 90 additions and 31 deletions

View File

@@ -1,5 +1,45 @@
2005-12-09 Paul Eggert <eggert@cs.ucla.edu> 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
Work around portability problem on Solaris 10: flex-generated
files include <stdio.h> before <config.h>, which messes up
because the latter defines __EXTENSIONS__. Address the problem
by creating two new little files that include <config.h> first,
then include the flex-generated files. Rewrite everyone else
to include <config.h> first, as well.
* lib/timevar.c: Always include "config.h".
* src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
(EXTRA_bison_SOURCES): New macro.
* src/scan-gram-c.c, src/scan-skel-c.c: New files.
* src/system.h: Don't include config.h.
* src/LR0.c: Include <config.h> first.
* src/assoc.c: Likewise.
* src/closure.c: Likewise.
* src/complain.c: Likewise.
* src/conflicts.c: Likewise.
* src/derives.c: Likewise.
* src/files.c: Likewise.
* src/getargs.c: Likewise.
* src/gram.c: Likewise.
* src/lalr.c: Likewise.
* src/location.c: Likewise.
* src/main.c: Likewise.
* src/muscle_tab.c: Likewise.
* src/nullable.c: Likewise.
* src/output.c: Likewise.
* src/parse-gram.y: Likewise.
* src/print.c: Likewise.
* src/print_graph.c: Likewise.
* src/reader.c: Likewise.
* src/reduce.c: Likewise.
* src/relation.c: Likewise.
* src/state.c: Likewise.
* src/symlist.c: Likewise.
* src/symtab.c: Likewise.
* src/tables.c: Likewise.
* src/uniqstr.c: Likewise.
* src/vcg.c: Likewise.
* src/parse-gram.y: Fix minor problems uncovered by lint. * src/parse-gram.y: Fix minor problems uncovered by lint.
(current_lhs, current_lhs_location): Now static. (current_lhs, current_lhs_location): Now static.
(current_assoc): Remove unused variable. (current_assoc): Remove unused variable.

View File

@@ -1,5 +1,5 @@
/* Timing variables for measuring compiler performance. /* Timing variables for measuring compiler performance.
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com> Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -19,9 +19,10 @@ along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include "config.h"
#if IN_GCC #if IN_GCC
#include "config.h"
#include "system.h" #include "system.h"
#include "intl.h" #include "intl.h"
#include "rtl.h" #include "rtl.h"

View File

@@ -24,6 +24,7 @@
/* See comments in state.h for the data structures that represent it. /* See comments in state.h for the data structures that represent it.
The entry point is generate_states. */ The entry point is generate_states. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -53,8 +53,8 @@ bison_SOURCES = \
reader.c reader.h \ reader.c reader.h \
reduce.c reduce.h \ reduce.c reduce.h \
relation.c relation.h \ relation.c relation.h \
scan-gram.l \ scan-gram-c.c \
scan-skel.h scan-skel.l \ scan-skel-c.c scan-skel.h \
state.c state.h \ state.c state.h \
symlist.c symlist.h \ symlist.c symlist.h \
symtab.c symtab.h \ symtab.c symtab.h \
@@ -64,6 +64,8 @@ bison_SOURCES = \
vcg.c vcg.h \ vcg.c vcg.h \
vcg_defaults.h vcg_defaults.h
EXTRA_bison_SOURCES = scan-skel.l scan-gram.l
BUILT_SOURCES = scan-skel.c scan-gram.c parse-gram.c parse-gram.h BUILT_SOURCES = scan-skel.c scan-gram.c parse-gram.c parse-gram.h
MOSTLYCLEANFILES = yacc MOSTLYCLEANFILES = yacc

View File

@@ -1,5 +1,5 @@
/* Associativity information. /* Associativity information.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -18,6 +18,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include "assoc.h" #include "assoc.h"

View File

@@ -1,7 +1,7 @@
/* Closures for Bison /* Closures for Bison
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004 Free Software Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -20,6 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -1,5 +1,6 @@
/* Declaration for error-reporting function for Bison. /* Declaration for error-reporting function for Bison.
Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it 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 the under the terms of the GNU General Public License as published by the
@@ -19,6 +20,7 @@
/* Based on error.c and error.h, /* Based on error.c and error.h,
written by David MacKenzie <djm@gnu.ai.mit.edu>. */ written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#include <config.h>
#include "system.h" #include "system.h"
#include <stdarg.h> #include <stdarg.h>

View File

@@ -20,6 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -1,7 +1,7 @@
/* Match rules with nonterminals for bison, /* Match rules with nonterminals for bison,
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2005 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -20,7 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include "getargs.h" #include "getargs.h"

View File

@@ -20,7 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <error.h> #include <error.h>

View File

@@ -20,6 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <argmatch.h> #include <argmatch.h>

View File

@@ -1,7 +1,7 @@
/* Allocate input grammar variables for Bison. /* Allocate input grammar variables for Bison.
Copyright (C) 1984, 1986, 1989, 2001, 2002, 2003 Free Software Copyright (C) 1984, 1986, 1989, 2001, 2002, 2003, 2005 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -20,7 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <quotearg.h> #include <quotearg.h>

View File

@@ -1,6 +1,6 @@
/* Compute look-ahead criteria for Bison. /* Compute look-ahead criteria for Bison.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003, 2004 Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -25,6 +25,7 @@
which rules need look-ahead in each state, and which look-ahead which rules need look-ahead in each state, and which look-ahead
tokens they accept. */ tokens they accept. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -1,5 +1,6 @@
/* Locations for Bison /* Locations for Bison
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -18,6 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <quotearg.h> #include <quotearg.h>

View File

@@ -20,7 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset_stats.h> #include <bitset_stats.h>

View File

@@ -20,6 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <hash.h> #include <hash.h>

View File

@@ -1,6 +1,6 @@
/* Calculate which nonterminals can expand into the null string for Bison. /* Calculate which nonterminals can expand into the null string for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004, 2005 Free
Software Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -25,6 +25,7 @@
the null string. NULLABLE[I - NTOKENS] is nonzero if symbol I can the null string. NULLABLE[I - NTOKENS] is nonzero if symbol I can
do so. */ do so. */
#include <config.h>
#include "system.h" #include "system.h"
#include "getargs.h" #include "getargs.h"

View File

@@ -20,7 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <error.h> #include <error.h>

View File

@@ -20,6 +20,7 @@
02110-1301 USA 02110-1301 USA
*/ */
#include <config.h>
#include "system.h" #include "system.h"
#include "complain.h" #include "complain.h"

View File

@@ -1,6 +1,6 @@
/* Print information on generated parser, for bison, /* Print information on generated parser, for bison,
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003, 2004 Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -20,7 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -19,6 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <quotearg.h> #include <quotearg.h>

View File

@@ -20,6 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <quotearg.h> #include <quotearg.h>

View File

@@ -1,7 +1,7 @@
/* Grammar reduction for Bison. /* Grammar reduction for Bison.
Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003 Free Software Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003, 2005 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -27,6 +27,7 @@
/* Don't eliminate unreachable terminals: They may be used by the /* Don't eliminate unreachable terminals: They may be used by the
user's parser. */ user's parser. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitset.h> #include <bitset.h>

View File

@@ -18,6 +18,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitsetv.h> #include <bitsetv.h>

View File

@@ -19,7 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <hash.h> #include <hash.h>

View File

@@ -19,6 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include "complain.h" #include "complain.h"

View File

@@ -20,7 +20,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <hash.h> #include <hash.h>

View File

@@ -20,10 +20,6 @@
#ifndef BISON_SYSTEM_H #ifndef BISON_SYSTEM_H
#define BISON_SYSTEM_H #define BISON_SYSTEM_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -20,7 +20,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <bitsetv.h> #include <bitsetv.h>

View File

@@ -19,6 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <error.h> #include <error.h>

View File

@@ -19,6 +19,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "system.h" #include "system.h"
#include <quotearg.h> #include <quotearg.h>