summaryrefslogtreecommitdiff
path: root/libcpp/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/expr.c')
-rw-r--r--libcpp/expr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 61bc1b21af18..a4cf75059583 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -1031,9 +1031,11 @@ parse_defined (cpp_reader *pfile)
if (node)
{
- if (pfile->context != initial_context && CPP_PEDANTIC (pfile))
- cpp_error (pfile, CPP_DL_WARNING,
- "this use of \"defined\" may not be portable");
+ if ((pfile->context != initial_context
+ || initial_context != &pfile->base_context)
+ && CPP_OPTION (pfile, warn_expansion_to_defined))
+ cpp_pedwarning (pfile, CPP_W_EXPANSION_TO_DEFINED,
+ "this use of \"defined\" may not be portable");
_cpp_mark_macro_used (node);
if (!(node->flags & NODE_USED))