This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fixinc & KR compiler
- To: gcc-patches at gcc dot gnu dot org (gcc-patches at gcc dot gnu dot org)
- Subject: fixinc & KR compiler
- From: "Philippe De Muyter" <phdm at macqel dot be>
- Date: Sun, 31 Oct 1999 16:56:09 +0100 (CET)
Symptoms :
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c", line 27: illegal character:
043 (octal)
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c", line 27: cannot recover fro
m earlier errors: goodbye!
**Error: /share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c: 29: Can't find inclu
de file sys/mman.h
"/usr/include/sys/fcntl.h", line 52: redeclaration of flock
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixtests.c", line 170: illegal characte
r: 043 (octal)
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixtests.c", line 170: cannot recover f
rom earlier errors: goodbye!
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c", line 533: syntax error
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c", line 533: illegal character
: 134 (octal)
"/share/src/gnu/egcs-19991013/gcc/fixinc/fixincl.c", line 533: cannot recover fr
om earlier errors: goodbye!
Fix :
Sun Oct 31 15:48:49 1999 Philippe De Muyter <phdm@macqel.be>
* fixinc/fixtests.c, fixinc/fixfixes.c : Keep `#' in first column for
old cpp's.
* fixinc/fixincl.c (fcntl.h) : Do not include this file twice.
(sys/mman.h): Include this file only if #HAVE_MMAP.
(run_compiles): Initialize `esac_fmt' with one old KR string, not
with automatically concatenated ANSI strings.
--- ./gcc/fixinc/fixtests.c Sun Oct 31 13:09:44 1999
+++ ./gcc/fixinc/fixtests.c Thu Oct 21 17:26:18 1999
@@ -167,10 +167,10 @@ run_test( tname, fname, text )
const char* fname;
const char* text;
{
- #define _FT_(n,p) { n, p },
+#define _FT_(n,p) { n, p },
static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }};
- #undef _FT_
- #define TEST_TABLE_CT ((sizeof(test_table)/sizeof(test_table[0]))-1)
+#undef _FT_
+#define TEST_TABLE_CT ((sizeof(test_table)/sizeof(test_table[0]))-1)
int ct = TEST_TABLE_CT;
test_entry_t* pte = test_table;
./gcc/fixinc/fixincl.c
--- ./gcc/fixinc/fixincl.c Sun Oct 31 13:09:44 1999
+++ ./gcc/fixinc/fixincl.c Thu Oct 21 17:58:53 1999
@@ -24,9 +24,10 @@
#include "fixlib.h"
- #include <fcntl.h>
- #include <sys/mman.h>
- #define BAD_ADDR ((void*)-1)
+#if HAVE_MMAP
+#include <sys/mman.h>
+#define BAD_ADDR ((void*)-1)
+#endif
#include <signal.h>
@@ -528,10 +529,8 @@ run_compiles ()
&& (p_fixd->papz_machs != (const char**) NULL) )
{
tSCC case_fmt[] = "case %s in\n"; /* 9 bytes, plus string */
- tSCC esac_fmt[] = " )\n" /* 3 bytes */
- " echo %s ;;\n" /* 13 bytes */
- "* ) echo %s ;;\n" /* 13 bytes */
- "esac"; /* 4 bytes */
+ tSCC esac_fmt[] =
+ " )\n echo %s ;;\n* ) echo %s ;;\nesac";/* 4 bytes */
tSCC skip[] = "skip"; /* 4 bytes */
tSCC run[] = "run"; /* 3 bytes */
/* total bytes to add to machine sum: 49 - see fixincl.tpl */
./gcc/fixinc/fixfixes.c
--- ./gcc/fixinc/fixfixes.c Sun Oct 31 13:09:45 1999
+++ ./gcc/fixinc/fixfixes.c Thu Oct 21 17:29:22 1999
@@ -192,10 +192,10 @@ apply_fix( fixname, filname )
const char* fixname;
const char* filname;
{
- #define _FT_(n,p) { n, p },
+#define _FT_(n,p) { n, p },
static fix_entry_t fix_table[] = { FIXUP_TABLE { NULL, NULL }};
- #undef _FT_
- #define FIX_TABLE_CT ((sizeof(fix_table)/sizeof(fix_table[0]))-1)
+#undef _FT_
+#define FIX_TABLE_CT ((sizeof(fix_table)/sizeof(fix_table[0]))-1)
char* buf;
int ct = FIX_TABLE_CT;