[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bison output file should not second-guess autoconf re 'const'
From: |
Paul Eggert |
Subject: |
Bison output file should not second-guess autoconf re 'const' |
Date: |
Fri, 17 Aug 2001 16:39:35 -0700 (PDT) |
Bison 1.28c still generates the following code:
#ifndef __cplusplus
# ifndef __STDC__
# define const
# endif
#endif
This code is incompatible with the more modern tradition where it's
the job of 'configure' to #define const when necessary. This has
caused me problem on more than one occasion, when 'configure' decides
to #define const, but the above code decides not to define it (or vice
versa), causing declaration incompatibilities when part of the code
defines const and part does not.
Here is a patch.
2001-08-17 Paul Eggert <address@hidden>
* src/output.c (output): Do not define const, as this now
causes more problems than it cures.
===================================================================
RCS file: NEWS,v
retrieving revision 1.28.3.0
retrieving revision 1.28.3.1
diff -pu -r1.28.3.0 -r1.28.3.1
--- NEWS 2001/08/15 07:56:19 1.28.3.0
+++ NEWS 2001/08/17 23:28:50 1.28.3.1
@@ -3,6 +3,8 @@ Bison News
Changes in version 1.28c:
+* Output file does not redefine const; that is now config.h's job.
+
* The Bison manual is now distributed under the terms of the GNU FDL.
* The input and the output files has automatically a similar extension.
===================================================================
RCS file: src/output.c,v
retrieving revision 1.28.3.0
retrieving revision 1.28.3.1
diff -pu -r1.28.3.0 -r1.28.3.1
--- src/output.c 2001/08/13 14:20:01 1.28.3.0
+++ src/output.c 2001/08/17 23:28:50 1.28.3.1
@@ -1340,15 +1340,6 @@ output (void)
if (!no_parser_flag)
obstack_sgrow (&table_obstack, "#include <stdio.h>\n\n");
- /* Make "const" do nothing if not in ANSI C. */
- obstack_sgrow (&table_obstack, "\
-#ifndef __cplusplus\n\
-# ifndef __STDC__\n\
-# define const\n\
-# endif\n\
-#endif\n\
-\n");
-
free_itemsets ();
output_defines ();
output_token_translations ();
- Bison output file should not second-guess autoconf re 'const',
Paul Eggert <=