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]

More fast-fixinc fun



We are currently failing to fix

#endif / * whatever * /

Which appears on alpha-dec-osf4.0a

Similarly we are failing to fix

#endif /% something %/

Which appears on aix4.2

(Don't you just love vendors that have this crud in their include files.)

The problem is the selector for the #endif fix.  There is nothing in those
files which triggers the current selector.

Reviewing the old fixincludes script indicated that they were fixed because
they had a match for a selector related to a completely different subfix that
happened to be performed as part of the same hairy fix (aka the "big sed loop")

When the "big sed loop" fix in fixincludes was broken into smaller fixes the
selectors were also separated based on what fix they applied to.  And as a
result the "#endif" fix selector did not identify the files with these bogus
#endif constructs.

The attached patch fixes both problems.


	* fixinc/inclhack.def (endif_label): Add additional selector for
	more bogus stuff after #endif statements.
	* fixinc/inclhack.sh, fixinc/fixincl.x: Rebuilt.

Index: inclhack.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.14.4.10
diff -c -3 -p -r1.14.4.10 inclhack.def
*** inclhack.def	1999/06/10 22:23:01	1.14.4.10
--- inclhack.def	1999/06/11 08:42:10
*************** fix = {
*** 421,433 ****
       *  match '#endif / * foo * /', but it also wont match
       *  '#endif / done' either.
       *
       *  We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a 
noncomment
       *  following #else or #endif because some buggy egreps think [^/] 
matches
       *  newline, and they thus think `#else ' matches
       *  `#e[ndiflse]*[ \t]+[^/ \t]'.
       *  [!-.0-~] does not work properly on AIX 4.1.
       */
!     select   = "^[ \t]*#[ \t]*endif[ \t]+[!-.0-z\{\|\}\~]";
  
      /*
       *  First, join the continued input lines.
--- 421,439 ----
       *  match '#endif / * foo * /', but it also wont match
       *  '#endif / done' either.
       *
+      *  We have a second regexp in the selector to detect
+      *  #endif followed by a / followed by anything other
+      *  than a *.  For example "#endif / * foo * /" or 
+      *  "#endif /% blah %/ which appear on OSF4.0A and AIX4.2
+      *  repsectively.
+      * 
       *  We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a 
noncomment
       *  following #else or #endif because some buggy egreps think [^/] 
matches
       *  newline, and they thus think `#else ' matches
       *  `#e[ndiflse]*[ \t]+[^/ \t]'.
       *  [!-.0-~] does not work properly on AIX 4.1.
       */
!     select   = "^[ \t]*#[ \t]*endif[ \t]+[!-.0-z\{\|\}\~]|^[ \t]*#[ 
\t]*endif[ \t]+/[^\*]";
  
      /*
       *  First, join the continued input lines.





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