[PATCH v3 2/7] malloc/obstack.h: Assume GCC supports __extension__

Alejandro Colomar alx@kernel.org
Mon Nov 10 23:05:40 GMT 2025


Hi Paul,

On Mon, Nov 10, 2025 at 08:39:03AM -0800, Paul Eggert wrote:
> On 2025-11-10 06:17, Alejandro Colomar wrote:
> > -# if ! (2 < __GNUC__ + (8 <= __GNUC_MINOR__))
> > -#  define __extension__
> > -# endif
> 
> If we're dropping support for GCC 2.7 and earlier in public-facing include
> files, this should be accompanied by an item in NEWS.
> 
> Also, there should be a section in the manual that says what user compilers
> are supported. For GCC we can simply say something like "2.8 or later"; for
> other compilers we needn't list specific compilers or versions, merely what
> C features are assumed. I suggest doing this by uncommenting the last
> paragraph in maint.texi (and thus bringing back an old compatibility
> appendix) and bringing it up to date. For the patches in this series, the
> following features should be documented in that part of the manual:
> 
> * #warning

I'll discard this, as if affects gnulib.

> * statement expressions (assuming we insist on them)

I'll drop this for now.

> * long long and associated macros like LLONG_MAX

Yup, I'll document this.  I'll start with long long, which I guess has
less controversy.

> * a stdarg.h that defines va_list

The relevant change is:

	 #if defined __USE_XOPEN2K || defined __USE_XOPEN2K8
	-# ifdef __GNUC__
	-#  ifndef _VA_LIST_DEFINED
	-typedef __gnuc_va_list va_list;
	-#   define _VA_LIST_DEFINED
	-#  endif
	-# else
	+# ifndef __GNUC__
	 #  include <stdarg.h>
	 # endif
	 #endif

I'm only changing the assumption if __GNUC__ is defined.  This change
assumes that GCC provides va_list in its own header.  However, I'm not
changing any assumptions for non-__GNUC__ compilers.

> Doing this documentation would perhaps be the most painful and important
> part of the whole exercise.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20251111/c7acad64/attachment.sig>


More information about the Libc-alpha mailing list