[doc,committed] document implicit extern "C" block in system headers

Message ID b354457d-f709-2bc0-3871-97f009eac675@codesourcery.com
State New
Headers show
Series
  • [doc,committed] document implicit extern "C" block in system headers
Related show

Commit Message

Sandra Loosemore Nov. 17, 2018, 5:07 p.m.
This patch is for PR4225, another ancient C++ documentation issue, in 
which a user expressed surprise at the implicit extern "C" block the 
preprocessor added to system headers specified via CPLUS_INCLUDE_PATH.

Presently RS/6000 AIX is the only remaining target that gives this 
special treatment to system headers; see
https://gcc.gnu.org/ml/gcc-patches/2018-07/msg00116.html

-Sandra

Patch

Index: gcc/doc/cpp.texi
===================================================================
--- gcc/doc/cpp.texi	(revision 266238)
+++ gcc/doc/cpp.texi	(working copy)
@@ -1131,6 +1131,9 @@  header, no matter where it was found.  C
 system_header}} has no effect in the primary source file.
 @end itemize
 
+On some targets, such as RS/6000 AIX, GCC implicitly surrounds all
+system headers with an @samp{extern "C"} block when compiling as C++.
+
 @node Macros
 @chapter Macros