* [PATCH 1/4] use lookup_macro() in handle_undef()
@ 2006-09-04 15:41 Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2006-09-04 15:41 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-sparse, Josh Triplett, Al Viro
The 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-20060904/pre-process.c~1HUCL 2006-09-03 23:32:31.000000000 +0400
+++ git-snapshot-20060904/pre-process.c 2006-09-04 17:19:51.000000000 +0400
@@ -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;
}
--
VGER BF report: H 0.0167159
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-04 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-04 15:41 [PATCH 1/4] use lookup_macro() in handle_undef() Oleg Nesterov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.