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]

Re: Patch to fixinc/inclhack.def *_quotes_def select pattern too strict


"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 =

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