You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cpplint uses a specific pattern for the header guards of a file. It looks to me that this pattern can lead to the same PP variable for different headers (with different names and paths).
Let me describe a simple scenario with two files:
include/foo_bar/baz.h
include/foo/bar_baz.h
Following cpplint rules both of them would end up using the header guard variable FOO_BAR_BAZ_H_.
Am I missing something or is this really the case? If it is, wouldn't it be better to change the rule to make these two result in different variables? E.g. a path separator could be transformed into a double underscore which would result in two different variables:
FOO_BAR__BAZ_H_
FOO__BAR_BAZ_H_
The text was updated successfully, but these errors were encountered:
Since I don't see which character would be allowed in a preprocessor name which isn't in a filename I suggested a double underscore. But any sequence would be subject to a potential collision if it is allowed in a filename.
cpplint
uses a specific pattern for the header guards of a file. It looks to me that this pattern can lead to the same PP variable for different headers (with different names and paths).Let me describe a simple scenario with two files:
include/foo_bar/baz.h
include/foo/bar_baz.h
Following
cpplint
rules both of them would end up using the header guard variableFOO_BAR_BAZ_H_
.Am I missing something or is this really the case? If it is, wouldn't it be better to change the rule to make these two result in different variables? E.g. a path separator could be transformed into a double underscore which would result in two different variables:
FOO_BAR__BAZ_H_
FOO__BAR_BAZ_H_
The text was updated successfully, but these errors were encountered: