This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fixinc/inclhack.def *_quotes_def select pattern too strict
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to fixinc/inclhack.def *_quotes_def select pattern too strict
- From: Bruce Korb <bkorb at sco dot COM>
- Date: Fri, 16 Jun 2000 10:33:24 -0700
- CC: gcc-patches at gcc dot gnu dot org
- Organization: Santa Cruz Operations
- References: <200006161650.MAA14087@caip.rutgers.edu>
"Kaveh R. Ghazi" wrote:
>
> The select patterns for the {io,ctrl}_quotes_def fixes are too strict
> because they expect a macro with at least two arguments. The c_fix
> actually works and the CTRL test_text actually has a single argument
> macro, but the select pattern matches the two argument text so the fix
> runs and the test passes. However if a header file only contains a
> macro with one argument, the select pattern will bypass the file.
>
> This patch modifies the select patterns to match IO and CTRL macros
> with one or more arguments by accepting a comma or close paren after
> the first argument, not just a comma.
>
> Tested by running fixincl on sunos4 and verifying it DTRT.
>
> Okay to install?
IFF you augment the test, too. :-)
I'll get around to fixing up the test results in a couple weeks.
- Bruce
> 2000-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
>
> * fixinc/inclhack.def (ctrl_quotes_def, io_quotes_def): Modify
> select pattern to also match macro defs with only one argument.
>
> diff -rup orig/egcs-CVS20000616/gcc/fixinc/inclhack.def egcs-CVS20000616/gcc/fixinc/inclhack.def
> --- orig/egcs-CVS20000616/gcc/fixinc/inclhack.def Mon Jun 5 17:02:53 2000
> +++ egcs-CVS20000616/gcc/fixinc/inclhack.def Fri Jun 16 12:24:49 2000
> @@ -888,7 +888,7 @@ fix = {
> */
> fix = {
> hackname = ctrl_quotes_def;
> - select = "define[ \t]+[A-Z0-9_]+CTRL\\([a-zA-Z],";
> + select = "define[ \t]+[A-Z0-9_]+CTRL\\([a-zA-Z][,)]";
> c_fix = char_macro_def;
> c_fix_arg = "CTRL";
> test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)\n"
+ "#define MUMBLE_CTRL(n) (('n'<<8)+MUMBLE_ID)\n"
> @@ -1142,7 +1142,7 @@ fix = {
> */
> fix = {
> hackname = io_quotes_def;
> - select = "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\([a-zA-Z],";
> + select = "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\([a-zA-Z][,)]";
> c_fix = char_macro_def;
> c_fix_arg = "IO";
> test_text =