Subject: bin/37222: The bmake parser should be more helpful to the developer
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <rillig@NetBSD.org>
List: netbsd-bugs
Date: 10/26/2007 10:30:00
>Number:         37222
>Category:       bin
>Synopsis:       The bmake parser should be more helpful to the developer
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 26 10:30:00 +0000 2007
>Originator:     Roland Illig
>Release:        pkgsrc-current
>Organization:
>Environment:
>Description:
The bmake parser should help the developer by issuing warnings for the most common mistakes. Ideally, the examples below shouldn't be accepted at all by the parser.

>How-To-Repeat:
# Nothing should be allowed between the function name and its argument.
.if empty or nonempty or whatever(foo)
.endif

# This isn't documented, so there should be at least a warning.
.if foo
.endif

# The error message should be "unknown preprocessing directive "elseif"".
# Currently it is: Missing dependency operator
.if defined(foo)
.elseif defined(bar)
.endif

When trying to use an undefined variable in an empty(VARNAME:M*) conditional, the error message should reflect that. Currently it is "Malformed conditional", although the _form_ of the conditional is not mal at all.

>Fix: