diff options
author | Zack Weinberg <zackw@stanford.edu> | 2001-04-02 16:29:32 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-04-02 16:29:32 +0000 |
commit | 0313e85b82d26887adb3cdab1dd8ce0a135135a3 (patch) | |
tree | 113af7fdc2e163e99c91162b13799deeae6fdb8d /gcc/gencodes.c | |
parent | 79cb7361fad4c4b58a09c1f6e64cf81c3cf9b8dc (diff) | |
download | gcc-0313e85b82d26887adb3cdab1dd8ce0a135135a3.tar.gz |
genattr.c, [...]: Wrap generated header in multiple-include guard.
* genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c,
gengenrtl.c: Wrap generated header in multiple-include guard.
Improve error checking.
From-SVN: r41006
Diffstat (limited to 'gcc/gencodes.c')
-rw-r--r-- | gcc/gencodes.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/gencodes.c b/gcc/gencodes.c index 3e14f39b8db..7e4f9644263 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -88,10 +88,10 @@ main (argc, argv) if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE) return (FATAL_EXIT_CODE); - printf ("/* Generated automatically by the program `gencodes'\n\ -from the machine description file `md'. */\n\n"); - - printf ("#ifndef MAX_INSN_CODE\n\n"); + puts ("/* Generated automatically by the program `gencodes'"); + puts (" from the machine description file `md'. */\n"); + puts ("#ifndef GCC_INSN_CODES_H"); + puts ("#define GCC_INSN_CODES_H\n"); /* Read the machine description. */ @@ -118,10 +118,12 @@ from the machine description file `md'. */\n\n"); output_predicate_decls (); - printf ("\n#endif /* MAX_INSN_CODE */\n"); + puts("\n#endif /* GCC_INSN_CODES_H */"); + + if (ferror (stdout) || fflush (stdout) || fclose (stdout)) + return FATAL_EXIT_CODE; - fflush (stdout); - return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + return SUCCESS_EXIT_CODE; } /* Define this so we can link with print-rtl.o to get debug_rtx function. */ |