+2018-07-05 Nathan Sidwell <nathan@acm.org>
+
+ Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C.
+ * doc/cpp.texi: Update comment.
+ * doc/tm.texi: Rebuilt.
+ * doc/tm.texi.in (NO_IMPLICIT_EXTERN_C): Replace with ...
+ (SYSTEM_IMPLICIT_EXTERN_C): ... this, opposite sense.
+ * doc/extend.texi (Backwards Compatibility): Clarify it is system
+ headers affected by extern "C".
+ * system.h: Poison NO_IMPLICIT_EXTERN_C.
+ * config/alpha/alpha.h, config/arm/uclinux-elf.h,
+ config/bfin/elf.h, config/cris/cris.h, config/darwin.h,
+ config/dragonfly.h, config/freebsd.h, config/gnu-user.h,
+ config/i386/cygming.h, config/i386/djgpp.h, config/i386/nto.h,
+ config/ia64/hpux.h, config/lm32/lm32.h, config/lm32/uclinux-elf.h,
+ config/lynx.h, config/mips/elf.h, config/mmix/mmix.h,
+ config/netbsd.h, config/pa/pa-hpux.h, config/powerpcspe/sysv4.h,
+ config/riscv/elf.h, config/rs6000/sysv4.h, config/rtems.h,
+ config/s390/tpf.h, config/sh/newlib.h, config/sol2.h,
+ config/sparc/openbsd64.h, config/sparc/sp-elf.h,
+ config/sparc/sp64-elf.h, config/spu/spu.h,
+ config/stormy16/stormy16.h, config/v850/v850.h,
+ config/visium/visium.h, config/vx-common.h, config/xtensa/elf.h: Don't
+ define NO_IMPLICIT_EXTERN_C.
+ * config/rs6000/aix.h: Set SYSTEM_IMPLICIT_EXTERN_C.
+
2018-07-05 Tamar Christina <tamar.christina@arm.com>
PR target/84711
* tree-cfgcleanup.c (tree_forwarder_block_p): Do not return false at
-O0 if the locus represent UNKNOWN_LOCATION but have different values.
-
+
2018-06-19 Aaron Sawdey <acsawdey@linux.ibm.com>
* config/rs6000/rs6000-string.c (select_block_compare_mode): Check
+2018-07-05 Nathan Sidwell <nathan@acm.org>
+
+ * c-lex.c (fe_file_change): Check SYSTEM_IMPLICIT_EXTERN_C not
+ NO_IMPLICIT_EXTERN_C.
+
2018-06-28 Martin Liska <mliska@suse.cz>
* cppspec.c: Include opt-suggestions.h.
input_location = new_map->start_location;
(*debug_hooks->start_source_file) (line, LINEMAP_FILE (new_map));
-#ifndef NO_IMPLICIT_EXTERN_C
+#ifdef SYSTEM_IMPLICIT_EXTERN_C
if (c_header_level)
++c_header_level;
else if (LINEMAP_SYSP (new_map) == 2)
}
else if (new_map->reason == LC_LEAVE)
{
-#ifndef NO_IMPLICIT_EXTERN_C
+#ifdef SYSTEM_IMPLICIT_EXTERN_C
if (c_header_level && --c_header_level == 0)
{
if (LINEMAP_SYSP (new_map) == 2)
/* By default, turn on GDB extensions. */
#define DEFAULT_GDB_EXTENSIONS 1
-/* The system headers under Alpha systems are generally C++-aware. */
-#define NO_IMPLICIT_EXTERN_C
-
#define TARGET_SUPPORTS_WIDE_INT 1
} \
while (false)
-/* Do not assume anything about header files. */
-#define NO_IMPLICIT_EXTERN_C
-
/* The GNU C++ standard library requires that these macros be defined. */
#undef CPLUSPLUS_CPP_SPEC
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
#undef SUBTARGET_DRIVER_SELF_SPECS
#define SUBTARGET_DRIVER_SELF_SPECS \
"%{mfdpic:-msim} %{mid-shared-library:-msim}"
-
-#define NO_IMPLICIT_EXTERN_C
#define FUNCTION_MODE QImode
-#define NO_IMPLICIT_EXTERN_C
-
/*
* Local variables:
* eval: (c-set-style "gnu")
#define DARWIN_X86 0
#define DARWIN_PPC 0
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
/* Suppress g++ attempt to link in the math library automatically. */
#define MATH_LIBRARY ""
#undef OBJECT_FORMAT_ELF
#define OBJECT_FORMAT_ELF
-/* Don't assume anything about the header files. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C 1
-
/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */
#undef WCHAR_TYPE
#undef OBJECT_FORMAT_ELF
#define OBJECT_FORMAT_ELF
-/* Don't assume anything about the header files. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C 1
-
/* Follow FreeBSD's standard headers (<sys/_types.h> etc...). */
#undef WCHAR_TYPE
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
#endif
#endif
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef PROFILE_HOOK
#define PROFILE_HOOK(LABEL) \
if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef BSS_SECTION_ASM_OP
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
-#define NO_IMPLICIT_EXTERN_C 1
-
#define TARGET_POSIX_IO
#undef DBX_REGISTER_NUMBER
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
-/* HP-UX headers are C++-compatible. */
-#define NO_IMPLICIT_EXTERN_C
-
/* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
FUNCTION_PROFILER defined because its use is not ifdefed. When using
PROFILE_HOOK, the profile call comes after the prologue. */
#define FUNCTION_MODE SImode
-#ifndef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-#endif
-
#define STORE_FLAG_VALUE 1
/* elfos.h should have already been included. Now just override
any conflicting definitions and add any extras. */
-/* Do not assume anything about header files. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
/* The GNU C++ standard library requires that these macros be defined. */
#undef CPLUSPLUS_CPP_SPEC
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#endif
-/* We have C++ support in our system headers. */
-
-#ifndef NO_IMPLICIT_EXTERN_C
-# define NO_IMPLICIT_EXTERN_C
-#endif
-
#ifndef TARGET_POSIX_IO
# define TARGET_POSIX_IO
#endif
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-
-#define NO_IMPLICIT_EXTERN_C 1
#define FUNCTION_MODE QImode
-#define NO_IMPLICIT_EXTERN_C
-
/* mmix-knuth-mmixware target has no support of C99 runtime */
#undef TARGET_LIBC_HAS_FUNCTION
#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
#undef TARGET_POSIX_IO
#define TARGET_POSIX_IO
-/* Don't assume anything about the header files. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C 1
-
/* Define some types that are the same on all NetBSD platforms,
making them agree with <machine/ansi.h>. */
"%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
#endif
-/* hpux8 and later have C++ compatible include files, so do not
- pretend they are `extern "C"'. */
-#define NO_IMPLICIT_EXTERN_C
-
/* hpux11 and earlier don't have fputc_unlocked, so we must inhibit the
transformation of fputs_unlocked and fprintf_unlocked to fputc_unlocked. */
#define DONT_HAVE_FPUTC_UNLOCKED
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* Header files should be C++ aware in general. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
/* Yes! We are ELF. */
#define TARGET_OBJECT_FORMAT OBJECT_ELF
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s"
-
-#define NO_IMPLICIT_EXTERN_C 1
#undef TARGET_AIX
#define TARGET_AIX 1
+/* System headers are not C++-aware. */
+#define SYSTEM_IMPLICIT_EXTERN_C 1
+
/* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used
in the #if conditional in options-default.h, so provide another macro. */
#undef TARGET_AIX_OS
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* Header files should be C++ aware in general. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
/* Yes! We are ELF. */
#define TARGET_OBJECT_FORMAT OBJECT_ELF
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* The system headers under RTEMS are C++-aware. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
/*
* Dummy start/end specification to let linker work as
* needed by autoconf scripts using this compiler.
#define ASM_APP_ON "#APP\n"
#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
-#define NO_IMPLICIT_EXTERN_C
#define TARGET_POSIX_IO
#undef SIZE_TYPE
#undef LIB_SPEC
#define LIB_SPEC "-lc -lgloss"
-
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C 1
-
produce the same format. */
#define NM_FLAGS "-png"
\f
-/* The system headers under Solaris 2 are C++-aware since 2.0. */
-#define NO_IMPLICIT_EXTERN_C
-
#define STDC_0_IN_SYSTEM_HEADERS 1
/* Support Solaris-specific format checking for cmn_err. */
} \
while (0)
-/* Inherited from sp64-elf. */
-#undef NO_IMPLICIT_EXTERN_C
-
#undef ASM_SPEC
#define ASM_SPEC "\
-s %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
/* It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
#define ASM_SPEC \
#undef SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL CM_EMBMEDANY
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef ASM_SPEC
#define ASM_SPEC "\
-s %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
#define FUNCTION_MODE QImode
-#define NO_IMPLICIT_EXTERN_C 1
-
/* Address spaces. */
#define ADDR_SPACE_EA 1
#define Pmode HImode
#define FUNCTION_MODE HImode
-
-#define NO_IMPLICIT_EXTERN_C
#define TARGET_ASM_INIT_SECTIONS v850_asm_init_sections
-/* Define this so that the cc1plus will not think that system header files
- need an implicit 'extern "C" { ... }' assumed. This breaks testing C++
- in a build directory where the libstdc++ header files are found via a
- -isystem <path-to-build-dir>. */
-#define NO_IMPLICIT_EXTERN_C
-
#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
((LENGTH) = v850_adjust_insn_length ((INSN), (LENGTH)))
machines this should be `QImode'. */
#define FUNCTION_MODE SImode
-/* `NO_IMPLICIT_EXTERN_C'
-
- Define this macro if the system header files support C++ as well as
- C. This macro inhibits the usual method of using system header
- files in C++, which is to pretend that the file's contents are
- enclosed in `extern "C" {...}'. */
-#define NO_IMPLICIT_EXTERN_C
-
/* Dividing the Output into Sections (Texts, Data, ...)
An object file is divided into sections containing different types
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* VxWorks headers are C++-aware. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
/* Most of these will probably be overridden by subsequent headers. We
undefine them here just in case, and define VXWORKS_ versions of each,
to be used in port-specific vxworks.h. */
#define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
+2018-07-05 Nathan Sidwell <nathan@acm.org>
+
+ * cp/decl.c (decls_match): Check SYSTEM_IMPLICIT_EXTERN_C not
+ NO_IMPLICIT_EXTERN_C.
+ * cp/parser.c (cp_parser_parameter_declaration_clause): Likewise.
+
2018-07-04 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/86398
{
if (!prototype_p (f2) && DECL_EXTERN_C_P (olddecl)
&& (DECL_BUILT_IN (olddecl)
-#ifndef NO_IMPLICIT_EXTERN_C
+#ifdef SYSTEM_IMPLICIT_EXTERN_C
|| (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl))
|| (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl))
#endif
if (p1 == void_list_node)
TREE_TYPE (newdecl) = TREE_TYPE (olddecl);
}
-#ifndef NO_IMPLICIT_EXTERN_C
+#ifdef SYSTEM_IMPLICIT_EXTERN_C
else if (!prototype_p (f1)
&& (DECL_EXTERN_C_P (olddecl)
&& DECL_IN_SYSTEM_HEADER (olddecl)
else if (token->type == CPP_CLOSE_PAREN)
/* There are no parameters. */
{
-#ifndef NO_IMPLICIT_EXTERN_C
+#ifdef SYSTEM_IMPLICIT_EXTERN_C
if (in_system_header_at (input_location)
&& current_class_type == NULL
&& current_lang_name == lang_name_c)
@item 4
This indicates that the following text should be treated as being
wrapped in an implicit @code{extern "C"} block.
-@c maybe cross reference NO_IMPLICIT_EXTERN_C
+@c maybe cross reference SYSTEM_IMPLICIT_EXTERN_C
@end table
As an extension, the preprocessor accepts linemarkers in non-assembler
@item Implicit C language
Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
-scope to set the language. On such systems, all header files are
+scope to set the language. On such systems, all system header files are
implicitly scoped inside a C language scope. Also, an empty prototype
@code{()} is treated as an unspecified number of arguments, rather
than no arguments, as C++ demands.
Define this hook to add target-specific C++ implicit extern C functions. If this function returns true for the name of a file-scope function, that function implicitly gets extern "C" linkage rather than whatever language linkage the declaration would normally have. An example of such function is WinMain on Win32 targets.
@end deftypefn
-@defmac NO_IMPLICIT_EXTERN_C
-Define this macro if the system header files support C++ as well as C@.
-This macro inhibits the usual method of using system header files in
-C++, which is to pretend that the file's contents are enclosed in
-@samp{extern "C" @{@dots{}@}}.
+@defmac SYSTEM_IMPLICIT_EXTERN_C
+Define this macro if the system header files do not support C++@.
+This macro handles system header files by pretending that system
+header files are enclosed in @samp{extern "C" @{@dots{}@}}.
@end defmac
@findex #pragma
@hook TARGET_CXX_IMPLICIT_EXTERN_C
-@defmac NO_IMPLICIT_EXTERN_C
-Define this macro if the system header files support C++ as well as C@.
-This macro inhibits the usual method of using system header files in
-C++, which is to pretend that the file's contents are enclosed in
-@samp{extern "C" @{@dots{}@}}.
+@defmac SYSTEM_IMPLICIT_EXTERN_C
+Define this macro if the system header files do not support C++@.
+This macro handles system header files by pretending that system
+header files are enclosed in @samp{extern "C" @{@dots{}@}}.
@end defmac
@findex #pragma
LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE \
EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT \
JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO \
- SDB_DEBUG
+ SDB_DEBUG NO_IMPLICIT_EXTERN_C
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \