|Anonymous | Login||2021-02-25 10:28 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001423||[Issue 8 drafts] Shell and Utilities||Objection||Clarification Requested||2020-11-18 21:28||2020-11-19 14:40|
|Status||New||Product Version||Draft 1.1|
|Final Accepted Text|
|Summary||0001423: The make commandline argument macro::=value has unspecified bahavior|
It is common accepted behavior that
overwrites definitions from makefiles. This can be implemented in
- evaluate the command line argument before reading makefiles
and mark the related macro readonly
- evaluate the command line argument after reading makefiles
Both methods result in the same result (even though the assumption
that command line arguments overwrite makefiles should be specified
in the standard). Note that the current text allows a make implementation
to evaluate command line macro assignments before reading makefiles
witout making them readonly and if this would be done, the assignments
in the makefiles would overwrite the commandline arguments.
With the command
the two possible implementations mentioned above give different
My gut feeling is that people would expect "make 'macro::=$(macro2)'"
expands $(macro2) as defined in the makefiles instead of expanding
it as empty macro value, but this needs to be specified in the standard.
After line 97005 after the text "in the order they appear"
insert the text:
as if the command line macro definitions were evaluated after reading the makefiles
|Tags||No tags attached.|
The claim that the behaviour is unspecified is incorrect, and the suggested change would contradict existing text that specifies the behaviour here (not because it would require different behaviour, but because the existing text handles this a different way). See draft 1.1 page 2896 lines 97343-97361 noting in particular line 97344 "before the makefile(s) are read" and lines 97360-97361 "Macros defined in the makefile(s) shall not override macro definitions from source 1 or source 2."
Can we process this bug as withdrawn?
edited on: 2020-11-19 11:29
The problem with that text is that it makes macro::=value on the
command line a useless feature since at that time, there are no
macro definitions that could be expanded.
So it would be a wise idea to remove macro::= value from the beginning
of line 97002.
This definitely needs to be discussed.
There can be macro definitions from earlier command line macro assignments. E.g.:
echo 'all: ; echo $(BAR)' | make -f - FOO=1 BAR::='$(FOO)' FOO=2is required to output 1 whereas with BAR='$(FOO)' it would output 2.
edited on: 2020-11-20 11:58
Just because you are correct with this note, people would
to expand previous definitions from FOO in the makefiles.
I know this is harder to implement, but shouldn't we avoid
to standardize unexpected results?
There is no such thing as "previous definitions from FOO in the makefiles". The standard clearly states that macro definitions are taken from the command line before the makefile(s) are read, as I pointed out in my first note.
Of course the usual "as if" rule applies here.
|2020-11-18 21:28||joerg||New Issue|
|2020-11-18 21:28||joerg||Name||=> Jörg Schilling|
|2020-11-18 21:28||joerg||Section||=> make|
|2020-11-18 21:28||joerg||Page Number||=> 2888|
|2020-11-18 21:28||joerg||Line Number||=> 97001-97006|
|2020-11-19 09:38||geoffclare||Note Added: 0005115|
|2020-11-19 11:29||joerg||Note Added: 0005116|
|2020-11-19 11:29||joerg||Note Edited: 0005116|
|2020-11-19 12:19||geoffclare||Note Added: 0005117|
|2020-11-19 13:39||joerg||Note Added: 0005118|
|2020-11-19 13:40||joerg||Note Edited: 0005118|
|2020-11-19 14:40||geoffclare||Note Added: 0005119|
|2020-11-20 11:58||joerg||Note Edited: 0005118|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|