* [PATCH 1/7] use lookup_macro() in handle_undef()
@ 2006-01-02 19:19 Oleg Nesterov
2006-01-18 10:31 ` Oleg Nesterov
2006-12-05 11:14 ` Josh Triplett
0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2006-01-02 19:19 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-sparse, Al Viro
Current code looks strange, I think it used to remove the symbol
from ->symbols list some time ago.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- git-snapshot-20060101/pre-process.c~1_HUCL 2006-01-01 00:13:52.000000000 +0300
+++ git-snapshot-20060101/pre-process.c 2006-01-02 20:04:22.000000000 +0300
@@ -1126,22 +1126,17 @@ static int handle_weak_define(struct str
static int handle_undef(struct stream *stream, struct token **line, struct token *token)
{
struct token *left = token->next;
- struct symbol **sym;
+ struct symbol *sym;
if (token_type(left) != TOKEN_IDENT) {
sparse_error(token->pos, "expected identifier to 'undef'");
return 1;
}
- sym = &left->ident->symbols;
- while (*sym) {
- struct symbol *t = *sym;
- if (t->namespace & (NS_MACRO | NS_INVISIBLEMACRO)) {
- t->namespace = NS_INVISIBLEMACRO;
- return 1;
- }
- sym = &t->next_id;
- }
+ sym = lookup_macro(left->ident);
+ if (sym)
+ sym->namespace = NS_INVISIBLEMACRO;
+
return 1;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-05 11:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-02 19:19 [PATCH 1/7] use lookup_macro() in handle_undef() Oleg Nesterov
2006-01-18 10:31 ` Oleg Nesterov
2006-12-05 11:14 ` Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).