another fixincludes patch, sun_auth_proto fix on sunos4...

korbb@egcs.cygnus.com korbb@egcs.cygnus.com
Tue Jun 8 13:59:00 GMT 1999


>  I found a third problem in the SunOS4

:-(

> It appears that bypass operates on the entire file, not the specific
> match found by the select.

Yes, "select", "bypass" and "test" are all independent tests.
They must all yield "fix the file" for the fix to be applied.

> The
> "select" finds it, but the "bypass" says skip it.  (In the case of the
> sunos4 header file, the declaration with parameters happens to be in a
> comment, see below.)
>
>  > /*
>  >  * A xdrproc_t exists for each data type which is to be encoded or decoded.
>  >  *
>  >  * The second argument to the xdrproc_t is a pointer to an opaque pointer.
>  >  * The opaque pointer generally points to a structure of the data type
>  >  * to be decoded.  If this pointer is 0, then the type routines should
>  >  * allocate dynamic storage of the appropriate size and return it.
>  >  * bool_t       (*xdrproc_t)(XDR *, caddr_t *);
>  >  */
>  > typedef bool_t (*xdrproc_t)();
> 
>         Since the sed command only appears to operate on line matches
> which don't have parameters, it seems safe to just nuke the "bypass"
> command.  One side effect is that if the header has a non-prototype
> region protected by !__STDC__, then that portion will get prototyped
> too.  Seems like no big deal if these headers are only used by gcc.
> But I'm open to better solutions.

I think  it would be better to prefix the current bypass expression
with:

    "^[a-zA-Z0-9_ \t]*"

which will fail to match whenever there are any punctuation
characters on the line that preceed the "(*xdrproc_t)" string.
It would be an improvement because it would avoid constructing
unnecessary header files, a waste of both time and space.
You might consider different solutions on the different paths,
tho, being more conservative on the 2.95 branch.

Regards,
    Bruce

1999-06-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

        * inclhack.def (sun_auth_proto): Remove the "bypass".

diff -rup orig/egcs-CVS19990607/gcc/fixinc/inclhack.def egcs-CVS19990607/gcc/fixinc/inclhack.def
--- orig/egcs-CVS19990607/gcc/fixinc/inclhack.def       Fri Jun  4 09:06:26 1999
+++ egcs-CVS19990607/gcc/fixinc/inclhack.def    Tue Jun  8 15:26:45 1999
@@ -1501,7 +1501,6 @@ fix = {
      *  but there is no point bothering if the fix is not needed.
      */
     select   = '\(\*[a-z][a-z_]*\)\(\)';
-    bypass   = '\(\*[a-z][a-z_]*\)\(' "[ \t]*[a-zA-Z.].*" '\)';
+    bypass   = "^[a-zA-Z0-9_ \t]*" '\(\*[a-z][a-z_]*\)\('
+               "[ \t]*[a-zA-Z.].*" '\)';
     sed      = 's'
                 '/^\(.*(\*[a-z][a-z_]*)(\)'      '\();.*\)'
                 "/\\\n"


More information about the Gcc-patches mailing list