Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!NCIFCRF.GOV!elsie!ado From: elsie!ado@NCIFCRF.GOV (Arthur David Olson) Newsgroups: gnu.gcc.bug Subject: Gnu C 1.30's fixincludes doesn't fix #else's and #endif's (with fix) Message-ID: <8810190042.AA00840@elsie.UUCP> Date: 19 Oct 88 00:42:45 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 63 (We're running SunOS 4.0 on a Sun 3/110.) Description: The "fixincludes" script passes along "#else" and "#endif" directives with "following text". Repeat-By: Script started on Tue Oct 18 20:37:24 1988 elsie$ echo "#include " > try.c elsie$ gcc -v -S -pedantic try.c gcc version 1.30 /usr/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -pedantic -D__HAVE_68881__ -Dmc68020 try.c /tmp/cca00328.cpp GNU CPP version 1.30 /usr/local/lib/gcc-include/sys/sockio.h:68: warning: text following #endif violates ANSI standard /usr/local/lib/gcc-cc1 /tmp/cca00328.cpp -quiet -dumpbase try.c -pedantic -version -o try.s GNU C version 1.30 (68k, MIT syntax) compiled by GNU C version 1.30. elsie$ sed -n 68p /usr/local/lib/gcc-include/sys/sockio.h #endif !_sockio_h elsie$ exit script done on Tue Oct 18 20:37:47 1988 Fix: While I don't believe include files should be "fixed" if all that's wrong them is bad #else/#endif directives, it seems reasonable to straighten the directives out in files that are being fixed for other reasons. The attached stuff also changes "doesn't" to "does not" rather than to "doesn''t". ------- fixincludes ------- *** /tmp/da8889 Tue Oct 18 20:26:42 1988 --- fixincludes Tue Oct 18 20:26:13 1988 *************** *** 28,33 **** --- 28,35 ---- g/#define._IO/s/'x'/x/g g/CTRL[ ]*(/s/\(.\))/'\1')/ g/#define.CTRL/s/'c'/c/g + g/^#[ ]*else[ ]*[^/]/s@\(#[ ]*endif\)\(.*\)@\1 /* \2 */@ + g/^#[ ]*endif[ ]*[^/]/s@\(#[ ]*endif\)\(.*\)@\1 /* \2 */@ wq EOF fi *************** *** 50,56 **** if [ -r ${LIB}/sundev/vuid_event.h ]; then echo Fixing sundev/vuid_event.h comment ex ${LIB}/sundev/vuid_event.h <