Open dirk-thomas opened 9 years ago
Then, how about: foo__bar.h foo/bar.h
There are only two options:
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_