aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-01-02 22:20:21 +0300
committerJosh Triplett <josh@freedesktop.org>2006-12-05 03:08:58 -0800
commit3c083484a3594f3c4e72fc06c001418a67dfe71a (patch)
treec90b2526ca36e8db30a00ce8ea41bbe45e45e1ec /symbol.h
parentprepare for #strong_{define,undef} (diff)
downloadsparse-3c083484a3594f3c4e72fc06c001418a67dfe71a.tar.gz
sparse-3c083484a3594f3c4e72fc06c001418a67dfe71a.tar.bz2
sparse-3c083484a3594f3c4e72fc06c001418a67dfe71a.zip
implement #strong_define
Example #strong_define FOO 1 #undef FOO // silently ignored #define FOO 2 // silently ignored This allows (for example) to override CONFIG_XXX values without editing include/linux/autoconf.h I think this is useful. If you think differently, I will appreciate your comments on this patch correctness. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Diffstat (limited to 'symbol.h')
-rw-r--r--symbol.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/symbol.h b/symbol.h
index 0803710..91cc06a 100644
--- a/symbol.h
+++ b/symbol.h
@@ -82,13 +82,14 @@ struct symbol_op {
extern int expand_safe_p(struct expression *expr, int cost);
extern int expand_constant_p(struct expression *expr, int cost);
-#define SYM_ATTR_WEAK 1
-#define SYM_ATTR_NORMAL 0
+#define SYM_ATTR_WEAK 0
+#define SYM_ATTR_NORMAL 1
+#define SYM_ATTR_STRONG 2
struct symbol {
enum namespace namespace:8;
enum type type:8;
- unsigned char used:1, attr:1;
+ unsigned char used:1, attr:2;
struct position pos; /* Where this symbol was declared */
struct ident *ident; /* What identifier this symbol is associated with */
struct symbol *next_id; /* Next semantic symbol that shares this identifier */