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]

another fixincludes patch, sun_auth_proto fix on sunos4...


	I found a third problem in the SunOS4 fixed includes with
respect to that produced by egcs-1.1.2.  This one comes from the
sun_auth_proto fix, which doesn't get applied.  The problem is the
"bypass" command.

It appears that bypass operates on the entire file, not the specific
match found by the select.  In this case, "select" is matching any
function pointer declarations without prototype parameters.  The
"bypass" is matching those with parameters.  The problem is what
happens when you have mixed declarations in a header file.  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.

	This is needed on both the trunk and the 2.95 branch.

		--Kaveh



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.].*" '\)';
     sed      = 's'
                 '/^\(.*(\*[a-z][a-z_]*)(\)'      '\();.*\)'
                 "/\\\n"


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