summaryrefslogtreecommitdiff
path: root/gcc/fix-header.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-22 09:31:41 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-22 09:31:41 +0000
commit65ba74c3f3bea3ba91f243e3c0711dc181c9572b (patch)
treeb605e199d2af799e1fad08d6fc58f9a34350d336 /gcc/fix-header.c
parent0c1173c49b26947e90e0b95544f91aa726279eb0 (diff)
downloadgcc-65ba74c3f3bea3ba91f243e3c0711dc181c9572b.tar.gz
* cse.c (rtx_cost): Add default case in enumeration switch.
* fix-header.c (recognized_macro): Likewise. (recognized_extern): Likewise. (write_rbrac): Likewise. * objc/objc-act.c (encode_aggregate): Likewise. (gen_declarator): Likewise. (gen_declspecs): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r--gcc/fix-header.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 24006513f64..3b5ec3a760f 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This program massages a system include file (such as stdio.h),
- into a form more conforming with ANSI/POSIX, and more suitable for C++:
+ into a form that is compatible with GNU C and GNU C++.
* extern "C" { ... } braces are added (inside #ifndef __cplusplus),
if they seem to be needed. These prevent C++ compilers from name
@@ -145,14 +145,31 @@ typedef int symbol_flags;
/* Used to mark names defined in the ANSI/ISO C standard. */
#define ANSI_SYMBOL 1
+/* We no longer massage include files for POSIX or XOPEN symbols,
+ as there are now several versions of the POSIX and XOPEN standards,
+ and it would be a maintenance nightmare for us to track them all.
+ Better to be compatible with the system include files. */
+/*#define ADD_MISSING_POSIX 1 */
+/*#define ADD_MISSING_XOPEN 1 */
+
+#if ADD_MISSING_POSIX
/* Used to mark names defined in the Posix.1 or Posix.2 standard. */
#define POSIX1_SYMBOL 2
#define POSIX2_SYMBOL 4
+#else
+#define POSIX1_SYMBOL 0
+#define POSIX2_SYMBOL 0
+#endif
+#if ADD_MISSING_XOPEN
/* Used to mark names defined in X/Open Portability Guide. */
#define XOPEN_SYMBOL 8
/* Used to mark names defined in X/Open UNIX Extensions. */
#define XOPEN_EXTENDED_SYMBOL 16
+#else
+#define XOPEN_SYMBOL 0
+#define XOPEN_EXTENDED_SYMBOL 0
+#endif
/* Used to indicate names that are not functions */
#define MACRO_SYMBOL 512
@@ -239,7 +256,7 @@ tan\0tanh\0" },
{ "stdio.h", ANSI_SYMBOL,
"clearerr\0fclose\0feof\0ferror\0fflush\0fgetc\0fgetpos\0\
fgets\0fopen\0fprintf\0fputc\0fputs\0fread\0freopen\0fscanf\0fseek\0\
-fsetpos\0ftell\0fwrite\0getc\0getchar\0gets\00perror\0popen\0\
+fsetpos\0ftell\0fwrite\0getc\0getchar\0gets\0perror\0\
printf\0putc\0putchar\0puts\0remove\0rename\0rewind\0scanf\0setbuf\0\
setvbuf\0sprintf\0sscanf\0vprintf\0vsprintf\0vfprintf\0tmpfile\0\
tmpnam\0ungetc\0" },
@@ -475,6 +492,10 @@ recognized_macro (fname)
else if (strcmp (fname, "S_IFREG") == 0) seen_S_IFREG++;
else if (strcmp (fname, "S_ISREG") == 0) seen_S_ISREG++;
}
+ break;
+
+ default:
+ break;
}
}
@@ -487,9 +508,12 @@ recognized_extern (name, name_length, type, type_length)
switch (special_file_handling)
{
case errno_h:
- if (strcmp (name, "errno") == 0 && !seen_errno)
+ if (name_length == 5 && strncmp (name, "errno", 5) == 0 && !seen_errno)
seen_errno = 1, required_other--;
break;
+
+ default:
+ break;
}
}
@@ -830,6 +854,9 @@ write_rbrac ()
fprintf (outf,
"#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)\n");
break;
+
+ default:
+ break;
}
@@ -1122,7 +1149,8 @@ main (argc, argv)
cur_symbol_table_size = 0;
for (entry = include_entry; ;)
{
- add_symbols (entry->flags, entry->names);
+ if (entry->flags)
+ add_symbols (entry->flags, entry->names);
entry++;
if (entry->name != CONTINUED)
break;