aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2019-10-28 10:59:47 -0700
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-30 11:16:01 +0100
commitf82caa52ae28298bb44cc6f2caf82870f869aa3c (patch)
treeba3fa08f5dfaf5200a70e106f11e41f41feb758f
parent8ab81af8985237432393894e814bb0ae1d7a1799 (diff)
downloadsparse-f82caa52ae28298bb44cc6f2caf82870f869aa3c.tar.gz
Add '__' prefix and suffix to all __attribute__ #defines
To avoid macro name collisions and improve portability the kernel want to use a double underscore prefix and suffix on all attributes. However, for some of them (mainly sparse's extensions), Sparse know only about the plain name. Teach Sparse about the double underscore for all attributes. Link: https://lore.kernel.org/r/7a15bc8ad7437dc3a044a4f9cd283500bd0b5f36.camel@perches.com Link: https://lore.kernel.org/r/19fd23e98bab65a1ee624445193bd2ed86108881.camel@perches.com Originally-by: Joe Perches <joe@perches.com> Reported-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--parse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 48a63f22..4b0a1566 100644
--- a/parse.c
+++ b/parse.c
@@ -345,6 +345,7 @@ static struct symbol_op goto_op = {
static struct symbol_op __context___op = {
.statement = parse_context_statement,
+ .attribute = attribute_context,
};
static struct symbol_op range_op = {
@@ -537,6 +538,7 @@ static struct init_keyword {
{ "while", NS_KEYWORD, .op = &while_op },
{ "do", NS_KEYWORD, .op = &do_op },
{ "goto", NS_KEYWORD, .op = &goto_op },
+ { "context", NS_KEYWORD, .op = &context_op },
{ "__context__",NS_KEYWORD, .op = &__context___op },
{ "__range__", NS_KEYWORD, .op = &range_op },
{ "asm", NS_KEYWORD, .op = &asm_op },
@@ -549,13 +551,17 @@ static struct init_keyword {
{ "aligned", NS_KEYWORD, .op = &aligned_op },
{ "__aligned__",NS_KEYWORD, .op = &aligned_op },
{ "nocast", NS_KEYWORD, MOD_NOCAST, .op = &attr_mod_op },
+ { "__nocast__", NS_KEYWORD, MOD_NOCAST, .op = &attr_mod_op },
{ "noderef", NS_KEYWORD, MOD_NODEREF, .op = &attr_mod_op },
+ { "__noderef__",NS_KEYWORD, MOD_NODEREF, .op = &attr_mod_op },
{ "safe", NS_KEYWORD, MOD_SAFE, .op = &attr_mod_op },
+ { "__safe__", NS_KEYWORD, MOD_SAFE, .op = &attr_mod_op },
{ "force", NS_KEYWORD, .op = &attr_force_op },
+ { "__force__", NS_KEYWORD, .op = &attr_force_op },
{ "bitwise", NS_KEYWORD, MOD_BITWISE, .op = &attr_bitwise_op },
{ "__bitwise__",NS_KEYWORD, MOD_BITWISE, .op = &attr_bitwise_op },
{ "address_space",NS_KEYWORD, .op = &address_space_op },
- { "context", NS_KEYWORD, .op = &context_op },
+ { "__address_space__",NS_KEYWORD, .op = &address_space_op },
{ "designated_init", NS_KEYWORD, .op = &designated_init_op },
{ "__designated_init__", NS_KEYWORD, .op = &designated_init_op },
{ "transparent_union", NS_KEYWORD, .op = &transparent_union_op },