bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] Missing lint warning ?


From: Hermann Peifer
Subject: [bug-gawk] Missing lint warning ?
Date: Thu, 08 Aug 2013 07:47:41 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7


Hi,

I just noted that in the below test code, `print undefined' generates a lint warning, whereas `x(undefined)' doesn't. Maybe this is a feature rather than a small bug. In any case, I found it worth reporting.

Hermann

$ cat test.awk
BEGIN { print undefined ; x(undefined) }

function x(a)
{
        if (a == "" && a == 0) {
                print "*** argument 'a' has not been given ***"
        }
}


$ gawk --lint -f test.awk
gawk: test.awk:1: warning: reference to uninitialized variable `undefined'

gawk: test.awk:5: warning: reference to uninitialized argument `a'
gawk: test.awk:5: warning: reference to uninitialized argument `a'
*** argument 'a' has not been given ***






reply via email to

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