This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fixincl.c - Several changes


Reply-To: ddsinc09@ix.netcom.com



David> fix-header is redefining EXIT_FAILURE and EXIT_SUCCESS in
David> stdlib.h on AIX.  I think this may be due to fix-header
David> parsing the file without seeing other header files which
David> enable and disable sections of stdlib.h so fix-header never
David> "sees" the existing definitions.  How does one prevent
David> fix-header from being too aggressive in its fixes?
David> 
David> Thanks, David

Some  people may object to my indentation style,
but something along these lines ought to work
fix-headers.c(write_rbrac):

<       if (!seen_EXIT_FAILURE)
<         fprintf (outf, "#define EXIT_FAILURE 1\n");
<       if (!seen_EXIT_SUCCESS)
<         fprintf (outf, "#define EXIT_SUCCESS 0\n");
---
>       if (!seen_EXIT_FAILURE)
>         fprintf (outf, "#ifndef EXIT_FAILURE\n"
>                        "#define EXIT_FAILURE 1\n"
>                        "#endif\n");
>       if (!seen_EXIT_SUCCESS)
>         fprintf (outf, "#ifndef EXIT_SUCCESS\n"
>                        "#define EXIT_SUCCESS 0\n"
>                        "#endif\n");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]