diff options
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r-- | libcpp/directives.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c index 3ee8bc4..2fdfaf0 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -831,8 +831,13 @@ do_include_common (cpp_reader *pfile, enum include_type type) } /* Prevent #include recursion. */ - if (pfile->line_table->depth >= CPP_STACK_MAX) - cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply"); + if (pfile->line_table->depth >= CPP_OPTION (pfile, max_include_depth)) + cpp_error (pfile, + CPP_DL_ERROR, + "#include nested depth %u exceeds maximum of %u" + " (use -fmax-include-depth=DEPTH to increase the maximum)", + pfile->line_table->depth, + CPP_OPTION (pfile, max_include_depth)); else { /* Get out of macro context, if we are. */ |