ado@NCIFCRF.GOV (Arthur David Olson) (10/19/88)
(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 <sys/ioctl.h>" > 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 <<EOF ! g/doesn't/s/doesn't/doesn''t/ wq EOF fi --- 52,58 ---- if [ -r ${LIB}/sundev/vuid_event.h ]; then echo Fixing sundev/vuid_event.h comment ex ${LIB}/sundev/vuid_event.h <<EOF ! g/doesn't/s/doesn't/does not/ wq EOF fi -- ado@ncifcrf.gov ADO is a trademark of Ampex.