- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Fixing headers
- From: Bruce Korb <bkorb at sco dot com>
- Date: Mon, 28 Feb 2000 09:07:14 -0800
- CC: Bruce Korb <autogen at linuxbox dot com>, EGCS Bug List <egcs-buts at gcc dot gnu dot org>
- Organization: Santa Cruz Operation
- References: <20000227154900Z.mitchell@codesourcery.com>
Mark Mitchell wrote:
>
> Here's another header fix that shouldn't be done. On RH6.1, in
> /usr/include/rpc/svc.h, there is:
[[...]]
> The "fixed" header looks like:
[[...]]
> * u_long vers;
>
> #ifdef __cplusplus
> * void (*dispatch)(...);
> #else
> * void (*dispatch)();
> #endif
> * u_long protocol; like TCP or UDP, zero means do not register
> */
>
> That's pretty gratuitous -- we're inside a comment.
Yep. It is "fixed" with a sed script. Sed does not keep context.
Please feel free to make a suggestion. The proper fix in sed
is going to be extremely complex. OTOH, you could insert a space
in the comment, thus:
> * void (*dispatch)( );
Assuming we have control of the header, that would
certainly be the easiest fix. This is the current
spec for the fix:
/*
* Apply fix this to all OSs since this problem seems to effect
* more than just SunOS.
*/
fix = {
hackname = sun_auth_proto;
files = rpc/auth.h;
files = rpc/clnt.h;
files = rpc/svc.h;
files = rpc/xdr.h;
/*
* Select those files containing '(*name)()'.
*/
select = '\(\*[a-z][a-z_]*\)\(\)';
sed = 's'
'/^\(.*(\*[a-z][a-z_]*)(\)' '\();.*\)'
"/\\\n"
"#ifdef __cplusplus\\\n"
'\1...\2' "\\\n"
"#else\\\n"
'\1\2' "\\\n"
"#endif"
"/";
};