[committed] libstdc++: Deprecate the --enable-cheaders=c_std configuration

Jonathan Wakely jwakely@redhat.com
Thu Aug 13 15:37:45 GMT 2020


These headers do not offer any tangible benefit compared to the default
c_global version. They are not actively maintained meaning that they
have bugs which have already been fixed for the c_global headers.

This change adds a warning if they are used, and requires a new
--enable-cheaders-obsolete option to allow their use. Unless we receive
reports from users who rely on the c_std headers they should be removed
at some point in future.

libstdc++-v3/ChangeLog:

	* acinclude.m4 (GLIBCXX_ENABLE_CHEADERS): Warn if the c_std
	option is used and fail unless --enable-cheaders-obsolete is
	also used.
	* configure: Regenerate.

Tested powerpc64le-linux. Committed to trunk.

-------------- next part --------------
commit 55484a0f816ef9ad7e13fb1057751223ed8471d8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 13 16:33:28 2020

    libstdc++: Deprecate the --enable-cheaders=c_std configuration
    
    These headers do not offer any tangible benefit compared to the default
    c_global version. They are not actively maintained meaning that they
    have bugs which have already been fixed for the c_global headers.
    
    This change adds a warning if they are used, and requires a new
    --enable-cheaders-obsolete option to allow their use. Unless we receive
    reports from users who rely on the c_std headers they should be removed
    at some point in future.
    
    libstdc++-v3/ChangeLog:
    
            * acinclude.m4 (GLIBCXX_ENABLE_CHEADERS): Warn if the c_std
            option is used and fail unless --enable-cheaders-obsolete is
            also used.
            * configure: Regenerate.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 26cf2197549..133125ec4fa 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2377,12 +2377,24 @@ dnl
 dnl --enable-cheaders= [does stuff].
 dnl --disable-cheaders [does not do anything, really].
 dnl  +  Usage:  GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
-dnl       Where DEFAULT is either 'c' or 'c_std' or 'c_global'.
+dnl       Where DEFAULT is either 'c' or 'c_global' or 'c_std'.
+dnl
+dnl To use the obsolete 'c_std' headers use --enable-cheaders-obsolete as
+dnl well as --enable-cheaders=c_std, otherwise configure will fail.
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_CHEADERS], [
+  GLIBCXX_ENABLE(cheaders-obsolete,no,,
+    [allow use of obsolete "C" headers for g++])
   GLIBCXX_ENABLE(cheaders,$1,[[[=KIND]]],
-    [construct "C" headers for g++], [permit c|c_std|c_global])
+    [construct "C" headers for g++], [permit c|c_global|c_std])
   AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
+  if test $enable_cheaders = c_std ; then
+    AC_MSG_WARN([the --enable-cheaders=c_std configuration is obsolete, c_global should be used instead])
+    AC_MSG_WARN([if you are unable to use c_global please report a bug or inform libstdc++@gcc.gnu.org])
+    if test $enable_cheaders_obsolete != yes ; then
+      AC_MSG_ERROR(use --enable-cheaders-obsolete to use c_std "C" headers)
+    fi
+  fi
 
   C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
 


More information about the Gcc-patches mailing list