aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-22 23:02:08 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-22 23:02:08 +0000
commit0f89df67fc5dbad0e6eb068f6facc4cbb0342c0d (patch)
treece631ea761f6a054491332ece44f6ba0154f01b3 /gcc/cpplib.c
parent4ff812cd3f08389d68aa257bbfa9baaf9dbda2cc (diff)
downloadgcc-0f89df67fc5dbad0e6eb068f6facc4cbb0342c0d.zip
gcc-0f89df67fc5dbad0e6eb068f6facc4cbb0342c0d.tar.gz
gcc-0f89df67fc5dbad0e6eb068f6facc4cbb0342c0d.tar.bz2
cpphash.c (trad_stringify, add_pat): New functions.
* cpphash.c (trad_stringify, add_pat): New functions. (collect_expansion): Restore support for -traditional syntax. Use trad_stringify and add_pat. (_cpp_macroexpand): Restore support for -traditional semantics. * cpplex.c (_cpp_scan_line): Don't change space_before if we get a COMMENT token. (_cpp_lex_token): Provide COMMENT tokens to caller if traditional and parsing_define_directive. (skip_comment): Warn about // comments if -Wtraditional. * cpplib.c (do_define): Fix typo. Create EMPTY nodes with proper node type. (do_undef): Don't warn about undefining EMPTY nodes. From-SVN: r33350
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index f881584..7f2554b 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -352,7 +352,7 @@ do_define (pfile)
if (list->tokens_used == 2 && list->tokens[1].type == CPP_VSPACE)
- empty = 0; /* Empty definition of object-like macro. */
+ empty = 1; /* Empty definition of object-like macro. */
/* If the next character, with no intervening whitespace, is '(',
then this is a function-like macro. Otherwise it is an object-
@@ -425,7 +425,8 @@ do_define (pfile)
}
else
{
- HASHNODE *hp = _cpp_make_hashnode (sym, len, T_MACRO, hash);
+ HASHNODE *hp = _cpp_make_hashnode (sym, len, empty ? T_EMPTY : T_MACRO,
+ hash);
hp->value.defn = def;
*slot = hp;
}
@@ -768,7 +769,7 @@ do_undef (pfile)
if (CPP_OPTION (pfile, debug_output))
pass_thru_directive (hp->name, len, pfile, T_UNDEF);
- if (hp->type != T_MACRO)
+ if (hp->type != T_MACRO && hp->type != T_EMPTY)
cpp_warning (pfile, "undefining `%s'", hp->name);
htab_clear_slot (pfile->hashtab, (void **)slot);