[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Space after continuation char "\ " causes "commands commence before
Paul D. Smith
Re: Space after continuation char "\ " causes "commands commence before first target" error
Thu, 8 Mar 2001 13:59:04 -0500
%% Stephen McInerney <address@hidden> writes:
sm> the point of my query was not 'why is this so'? but 'why is the error
sm> message so vague?' How about 'trailing whitespace on line <nn> invalid
sm> after the '\' continuation character'
Make cannot print this error because it is _NOT_ an error. It's
perfectly valid make syntax to have whitespace after a backslash.
It's possible that make could print a _warning_ if it sees the character
sequence "\<whitespace><newline>", on the assumption that most people
wouldn't do that on purpose. However, make currently doesn't have good
facilities for warnings, and most especially for disabling them, and
until it does I don't want to add many/any "style" warnings. That's
on the TODO list.
Make is not reporting the error that there's whitespace following the
backslash (because, as I've said, it's not an error). It's reporting
that the next line, which you wanted to be a continuation of the
previous one but wasn't due to the whitespace, doesn't make any sense.
The only way for make to report an error such as you suggest is for it
to somehow realize that the _previous_ line had this questionable syntax
(whitespace between the backslash and newline) at the end, then if it
sees an error on the current line it could suggest that it might have
been caused by the extra whitespace on the previous line.
Needless to say, that's gross.
sm> Would it be possible to change to the more intuitive standard syntax:
sm> [Makefile,12]: *** ...
>> Heh. "Intuitive standard syntax" to whom? :) On what platform are you
sm> Just a common practice with UNIX HW CAD tools, linters, Verilog.
sm> "12" looks like the error number to me and many other people.
sm> If you look at DejaNews you will see half the known universe wrongly
sm> believes this too :)
I don't get this. Are you saying that searching Deja will show me that
half the known universe feels that the GNU make error messages are not
clear? I don't think I've had any previous requests or bug reports on
this to the make mailing lists or bug database. They must be the
mythical "silent majority" :).
At any rate, all GNU tools use this syntax for error message reporting
(as do many other non-GNU tools) so I'm not willing to change GNU make's
syntax to be incompatible with them.
sm> I guess we need an example then?
I'll see what I can do.
Are you saying you read that chapter, but didn't realize that the "12"
was a linenumber, and that an example would have helped?
I feel the text is pretty clear:
Error messages are all either prefixed with the name of the program
(usually `make'), or, if the error is found in a makefile, the name of
the file and linenumber containing the problem.
Although of course examples can't hurt.
Paul D. Smith <address@hidden> Find some GNU make tips at:
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist