Allow multiple declarators in a declaration#5595
Conversation
|
Can we have testcase for this, please? |
One (small) testcase added. |
|
Seems like it should be a command-line option to toggle these extensions on/off. |
There is a command line option to turn the warnings on/off ( |
Hmm, for practical reasons this seems like a pedantic mode. I was mostly thinking to have a way to toggle extensions on/off in general. This way we could also prototype more work not compliant with the spec. |
|
9853a34 to
c6750bb
Compare
7059b1e to
658f0a5
Compare
Signed-off-by: Chris Dodd <cdodd@nvidia.com>
Some people consider multiple declarators in a declaration as one of the big mistakes of C, and think they should never be used. Some coding standards require that every variable be declared in a separate declaration, as P4 currently requires.
Other people coming to P4 from C or C++ are annoyed by this restriction, and try to write code with multiple declarators.
This change allows such declarations as an extension, and can warn about them as a non-standard extension.