* tradcpp.c (special_symbol): Improve test for definedness,
though it is still not perfect.
(do_define): Don't define illegal macro names.
From-SVN: r38230
+2000-12-13 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * tradcpp.c (special_symbol): Improve test for definedness,
+ though it is still not perfect.
+ (do_define): Don't define illegal macro names.
+
2000-12-07 Aldy Hernandez <aldyh@redhat.com>
* config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits
2000-12-07 Aldy Hernandez <aldyh@redhat.com>
* config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits
if (!is_idstart (*ip->bufp))
goto oops;
if (!is_idstart (*ip->bufp))
goto oops;
- if (lookup (ip->bufp, -1, -1))
- buf = " 1 ";
+ {
+ HASHNODE *hp = lookup (ip->bufp, -1, -1);
+
+ if (hp && hp->type != T_UNUSED && hp->type != T_SPEC_DEFINED)
+ buf = " 1 ";
+ }
while (is_idchar (*ip->bufp))
++ip->bufp;
SKIP_WHITE_SPACE (ip->bufp);
while (is_idchar (*ip->bufp))
++ip->bufp;
SKIP_WHITE_SPACE (ip->bufp);
}
sym_length = bp - symname;
if (sym_length == 0)
}
sym_length = bp - symname;
if (sym_length == 0)
- error ("invalid macro name");
+ {
+ error ("invalid macro name");
+ return;
+ }
else if (!is_idstart (*symname)) {
U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
memcpy (msg, symname, sym_length);
msg[sym_length] = 0;
error ("invalid macro name `%s'", msg);
else if (!is_idstart (*symname)) {
U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
memcpy (msg, symname, sym_length);
msg[sym_length] = 0;
error ("invalid macro name `%s'", msg);
} else {
if (! strncmp ((const char *)symname, "defined", 7) && sym_length == 7)
} else {
if (! strncmp ((const char *)symname, "defined", 7) && sym_length == 7)
- error ("defining `defined' as a macro");
+ {
+ error ("\"defined\" cannot be used as a macro name");
+ return;
+ }
}
/* lossage will occur if identifiers or control keywords are broken
}
/* lossage will occur if identifiers or control keywords are broken