aboutsummaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-08-20 15:28:15 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-08-20 15:28:15 +0000
commit7692e253ee0bdab40fb896991f9208112ebfff61 (patch)
treed7d8e0dbf2fb099ed1f39632f6d6f65ebdbd43c4 /libcpp/directives.c
parente11b709d2107a504c185d75d7e1a2b0b2a2dc6fe (diff)
downloadgcc-7692e253ee0bdab40fb896991f9208112ebfff61.zip
gcc-7692e253ee0bdab40fb896991f9208112ebfff61.tar.gz
gcc-7692e253ee0bdab40fb896991f9208112ebfff61.tar.bz2
[CPP PATCH] Fix warning & other cleanups.
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01162.html * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p. * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma. (cpp_fun_like_macro_p): Make inline, define. * macro.c (cpp_define_lazily): Use UCHAR_MAX. (cpp_fun_like_macro_p): Delete. From-SVN: r263666
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r--libcpp/directives.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c
index e75462f..f04ed7c 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -665,12 +665,12 @@ do_undef (cpp_reader *pfile)
/* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified
identifier is not currently defined as a macro name. */
- if (node->type == NT_MACRO)
+ if (cpp_macro_p (node))
{
if (node->flags & NODE_WARN)
cpp_error (pfile, CPP_DL_WARNING,
"undefining \"%s\"", NODE_NAME (node));
- else if ((node->flags & NODE_BUILTIN)
+ else if (cpp_builtin_macro_p (node)
&& CPP_OPTION (pfile, warn_builtin_macro_redefined))
cpp_warning_with_line (pfile, CPP_W_BUILTIN_MACRO_REDEFINED,
pfile->directive_line, 0,