bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yet another small observation about warnings


From: arnold
Subject: Re: Yet another small observation about warnings
Date: Fri, 20 Oct 2023 04:59:00 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thanks for the report.  Patch below.

Arnold

Hermann Peifer <peifer@gmx.eu> wrote:

>
> For information. Hermann
>
>
>  > # No warning here, that's fine for me.
>  > ./gawk 'BEGIN{0}'
>  >
>  > # A lint warning here, makes sense to me.
>  > ./gawk --lint 'BEGIN{0}'
> gawk: cmd. line:1: warning: statement has no effect
>  >
>  > # --profile makes the lint warning go away. Why?
>  > ./gawk --lint --profile 'BEGIN{0}'
>  >
>  > # Double use of -p or --profile triggers a strange warning
>  > ./gawk --lint -p -p 'BEGIN{0}'
> gawk: warning: `--profile' overrides `--pretty-print'

-----------------------------------------------------------
diff --git a/main.c b/main.c
index 9b63bad3..8a1adda7 100644
--- a/main.c
+++ b/main.c
@@ -1726,7 +1726,7 @@ parse_args(int argc, char **argv)
                        break;
 
                case 'p':
-                       if (do_pretty_print)
+                       if (do_pretty_print && ! do_profile)
                                warning(_("`--profile' overrides 
`--pretty-print'"));
                        do_flags |= DO_PROFILE;
                        /* fall through */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]