Preprocessor should fail on, or handle, '# ifdef' (space between # and ifdef)
Categories
(Firefox Build System :: General, defect, P3)
Tracking
(firefox115 fixed)
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: standard8, Assigned: sergesanspaille)
References
Details
Attachments
(1 file, 1 obsolete file)
We've just found two long standing bugs (2yr) in our preferences (see "See Also") which were both caused by code in StaticPrefsList.yaml of this form:
# ifdef XP_WIN
value: 1
# else
value: 0
# endif
There is even a warning at the start of this file:
# Note finally that this file is preprocessed by preprocessor.py, not the C++
# preprocessor. As a result, the following things may be surprising.
...
# - Spaces aren't permitted between the leading '#' and the name of a
# directive, e.g. `#ifdef XYZ` works but `# ifdef XYZ` does not.
We should either make the preprocessor fail on ifdefs with a space, or it should handle them.
Updated•3 years ago
|
Assignee | ||
Comment 1•1 year ago
|
||
This way it matches the C pre processor behavior many people are used
to.
The way this change is implemented also allows for non-command comments
to exist, e.g.
#hello
Used to be an error and it no longer is, it's just copy-pasted.
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Because the preprocessor handles both comments in the form of
some comment
And commands in the form of
#some command
And due to C preprocessor heritage, people tend to write
some command
which is considered a comment and not a command. Detect this situation
and generate an hard error when meeting such ambiguous commands.
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/51302571bf80 Detect ambiguous preprocessor.py commands r=glandium
Comment 4•1 year ago
|
||
Backed out for causing build bustages in modules/libpref/init/StaticPrefList.yaml
Backout link: https://hg.mozilla.org/integration/autoland/rev/6fc5ecc39bd6a902e822e503c098eee4c2aeb08e
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ee47853c14c Detect ambiguous preprocessor.py commands r=glandium
Updated•1 year ago
|
Comment 6•1 year ago
|
||
Backed out for causing build bustages in modules/libpref/init/StaticPrefList.yaml
Backout link: https://hg.mozilla.org/integration/autoland/rev/8289adf7c91fe94c278a9778346187961597dea2
Assignee | ||
Comment 7•1 year ago
|
||
Patch updated and pushed again. Sorry for the noise.
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34f3d7c398a2 Detect ambiguous preprocessor.py commands r=glandium
Comment 9•11 months ago
|
||
bugherder |
Description
•