aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren J. Rittle <ljrittle@acm.org>2003-04-04 21:46:49 +0000
committerLoren J. Rittle <ljrittle@gcc.gnu.org>2003-04-04 21:46:49 +0000
commit0705a2a26a8f761c0fa319adfae46e3cd0ade7be (patch)
tree248bc4d65ab182cad68722348bd60ce97b9850ab
parent1a4828810083a7e45cf8b53daa579052265e1e61 (diff)
downloadgcc-0705a2a26a8f761c0fa319adfae46e3cd0ade7be.zip
gcc-0705a2a26a8f761c0fa319adfae46e3cd0ade7be.tar.gz
gcc-0705a2a26a8f761c0fa319adfae46e3cd0ade7be.tar.bz2
inclhack.def (bsd_stdio_attrs_conflict): New.
* fixinc/inclhack.def (bsd_stdio_attrs_conflict): New. * fixinc/fixincl.x: Rebuilt. * fixinc/tests/base/stdio.h: Regenerated. From-SVN: r65248
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fixinc/fixincl.x46
-rw-r--r--gcc/fixinc/inclhack.def20
-rw-r--r--gcc/fixinc/tests/base/stdio.h7
4 files changed, 79 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 822d403..c15b2c2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-04 Loren James Rittle <ljrittle@acm.org>
+
+ * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
+ * fixinc/fixincl.x: Rebuilt.
+ * fixinc/tests/base/stdio.h: Regenerated.
+
2003-04-04 Nathan Sidwell <nathan@codesourcery.com>
* gcov.c (accumulate_line_counts): Fix span tree merge bug.
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index fd9d331..8391b41 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -1117,6 +1117,46 @@ static const char* apzBadquotePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Bsd_Stdio_Attrs_Conflict fix
+ */
+tSCC zBsd_Stdio_Attrs_ConflictName[] =
+ "bsd_stdio_attrs_conflict";
+
+/*
+ * File name selection pattern
+ */
+tSCC zBsd_Stdio_Attrs_ConflictList[] =
+ "|stdio.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzBsd_Stdio_Attrs_ConflictMachs[] = {
+ "*-*-*bsd*",
+ "*-*-*darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zBsd_Stdio_Attrs_ConflictSelect0[] =
+ "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
+
+#define BSD_STDIO_ATTRS_CONFLICT_TEST_CT 1
+static tTestDesc aBsd_Stdio_Attrs_ConflictTests[] = {
+ { TT_EGREP, zBsd_Stdio_Attrs_ConflictSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Bsd_Stdio_Attrs_Conflict
+ */
+static const char* apzBsd_Stdio_Attrs_ConflictPatch[] = {
+ "format",
+ "#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)\n\
+#define _BSD_STRINGX(_BSD_X) #_BSD_X\n\
+int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) \"__svfscanf\");",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Broken_Assert_Stdio fix
*/
tSCC zBroken_Assert_StdioName[] =
@@ -5871,6 +5911,7 @@ typedef enum {
BAD_LVAL_FIXIDX,
BAD_STRUCT_TERM_FIXIDX,
BADQUOTE_FIXIDX,
+ BSD_STDIO_ATTRS_CONFLICT_FIXIDX,
BROKEN_ASSERT_STDIO_FIXIDX,
BROKEN_ASSERT_STDLIB_FIXIDX,
BROKEN_CABS_FIXIDX,
@@ -6122,6 +6163,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
BADQUOTE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aBadquoteTests, apzBadquotePatch, 0 },
+ { zBsd_Stdio_Attrs_ConflictName, zBsd_Stdio_Attrs_ConflictList,
+ apzBsd_Stdio_Attrs_ConflictMachs,
+ BSD_STDIO_ATTRS_CONFLICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aBsd_Stdio_Attrs_ConflictTests, apzBsd_Stdio_Attrs_ConflictPatch, 0 },
+
{ zBroken_Assert_StdioName, zBroken_Assert_StdioList,
apzBroken_Assert_StdioMachs,
BROKEN_ASSERT_STDIO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 763df48..5256412 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -724,6 +724,26 @@ fix = {
/*
+ * Various systems derived from BSD4.4 contain a macro definition
+ * for vfscanf that interacts badly with requirements of builtin-attrs.def.
+ * Known to be fixed in FreeBSD 5 system headers.
+ */
+fix = {
+ hackname = bsd_stdio_attrs_conflict;
+ mach = *-*-*bsd*;
+ mach = *-*-*darwin*;
+ files = stdio.h;
+ select = "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
+ c_fix = format;
+ c_fix_arg = '#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)' "\n"
+ '#define _BSD_STRINGX(_BSD_X) #_BSD_X' "\n"
+ 'int vfscanf(FILE *, const char *, __builtin_va_list) '
+ '__asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) "__svfscanf");';
+ test_text = '#define vfscanf __svfscanf';
+};
+
+
+/*
* check for broken assert.h that needs stdio.h
*/
fix = {
diff --git a/gcc/fixinc/tests/base/stdio.h b/gcc/fixinc/tests/base/stdio.h
index bfa929f..d0eadbc 100644
--- a/gcc/fixinc/tests/base/stdio.h
+++ b/gcc/fixinc/tests/base/stdio.h
@@ -19,6 +19,13 @@ extern int getopt(int, char *const[], const char *);
#endif /* ALPHA_GETOPT_CHECK */
+#if defined( BSD_STDIO_ATTRS_CONFLICT_CHECK )
+#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)
+#define _BSD_STRINGX(_BSD_X) #_BSD_X
+int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) "__svfscanf");
+#endif /* BSD_STDIO_ATTRS_CONFLICT_CHECK */
+
+
#if defined( HPUX11_VSNPRINTF_CHECK )
extern int vsnprintf(char *, _hpux_size_t, const char *, __gnuc_va_list);
#endif /* HPUX11_VSNPRINTF_CHECK */