bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] can we get a warning for undefined behavior?


From: arnold
Subject: Re: [bug-gawk] can we get a warning for undefined behavior?
Date: Wed, 08 Aug 2018 06:20:22 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Hi.

Ed Morton <address@hidden> wrote:

> I notice that these:
>
> $ echo 'foo bar' | awk --lint '{NF--}1'        # UB: decrementing NF
> foo
>
> $ echo 'foo bar' | awk --lint 'END{print $0}'    # UB: using $0 in END
> foo bar

These two are medium hard to do. They're on my list, along with
the other things you sent in private email.

> $ echo 'foo bar' | awk --lint '/\o/'    # UB: backslash before literal char
> foo bar
>
> $ echo 'foo bar' | awk --lint '{print > "file" 1}'    # UB: unparenthesized 
> right side of I/O redirection

I have added warnings for these two and they're in the code base.

Thanks,

Arnold



reply via email to

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