summaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
commit34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch)
treed503eaf41d085669d1481bb46ec038bc866fece6 /libcpp/init.c
parentf733cf303bcdc952c92b81dd62199a40a1f555ec (diff)
downloadgcc-tarball-master.tar.gz
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'libcpp/init.c')
-rw-r--r--libcpp/init.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libcpp/init.c b/libcpp/init.c
index 4343075ba8..1477673245 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -1,5 +1,5 @@
/* CPP Library.
- Copyright (C) 1986-2016 Free Software Foundation, Inc.
+ Copyright (C) 1986-2017 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -189,6 +189,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table,
CPP_OPTION (pfile, warn_dollars) = 1;
CPP_OPTION (pfile, warn_variadic_macros) = 1;
CPP_OPTION (pfile, warn_builtin_macro_redefined) = 1;
+ CPP_OPTION (pfile, cpp_warn_implicit_fallthrough) = 0;
/* By default, track locations of tokens resulting from macro
expansion. The '2' means, track the locations with the highest
accuracy. Read the comments for struct
@@ -257,6 +258,9 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table,
/* Do not force token locations by default. */
pfile->forced_token_location_p = NULL;
+ /* Initialize source_date_epoch to -2 (not yet set). */
+ pfile->source_date_epoch = (time_t) -2;
+
/* The expression parser stack. */
_cpp_expand_op_stack (pfile);
@@ -495,7 +499,7 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
{
if (CPP_OPTION (pfile, lang) == CLK_CXX1Z
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX1Z)
- _cpp_define_builtin (pfile, "__cplusplus 201500L");
+ _cpp_define_builtin (pfile, "__cplusplus 201703L");
else if (CPP_OPTION (pfile, lang) == CLK_CXX14
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX14)
_cpp_define_builtin (pfile, "__cplusplus 201402L");
@@ -534,7 +538,7 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
}
/* Sanity-checks are dependent on command-line options, so it is
- called as a subroutine of cpp_read_main_file (). */
+ called as a subroutine of cpp_read_main_file. */
#if CHECKING_P
static void sanity_checks (cpp_reader *);
static void sanity_checks (cpp_reader *pfile)
@@ -613,6 +617,8 @@ cpp_post_options (cpp_reader *pfile)
const char *
cpp_read_main_file (cpp_reader *pfile, const char *fname)
{
+ const source_location loc = 0;
+
if (CPP_OPTION (pfile, deps.style) != DEPS_NONE)
{
if (!pfile->deps)
@@ -623,11 +629,12 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
}
pfile->main_file
- = _cpp_find_file (pfile, fname, &pfile->no_search_path, false, 0, false);
+ = _cpp_find_file (pfile, fname, &pfile->no_search_path, false, 0, false,
+ loc);
if (_cpp_find_failed (pfile->main_file))
return NULL;
- _cpp_stack_file (pfile, pfile->main_file, false);
+ _cpp_stack_file (pfile, pfile->main_file, false, loc);
/* For foo.i, read the original filename foo.c now, for the benefit
of the front ends. */