preproc: Warn if someone predefines non ID as definition

Not sure if someone is used this but to not break
backward compatibility lets simply yield error but
don't stop processing.

http://bugzilla.nasm.us/show_bug.cgi?id=3392300

Reported-by: Dave Shields <thedaveshields@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2015-02-08 11:07:17 +03:00
parent d9ca54b6d2
commit 6d42e9ba47

View File

@ -5203,6 +5203,10 @@ static void pp_pre_define(char *definition)
if (equals)
*equals = '=';
if (space->next->type != TOK_PREPROC_ID &&
space->next->type != TOK_ID)
error(ERR_WARNING, "pre-defining non ID `%s\'\n", definition);
l = nasm_malloc(sizeof(Line));
l->next = predef;
l->first = def;