[PATCH] Declare reallocarray by default

Joseph Myers joseph@codesourcery.com
Thu Aug 30 12:12:00 GMT 2018


On Thu, 30 Aug 2018, Florian Weimer wrote:

> > This seems reasonable to me. The choice of __USE_GNU was perhaps a
> > conservative one since it requires _GNU_SOURCE to be defined on the
> > user side and that enables a lot of extensions. Relaxing reallocarray
> > to __USE_MISC is a good choice if we are seeing developer problems
> > with this e.g. reallocarray is detected in some way at runtime, but
> > with the prototype missing (and compiler warnings ignored), and the
> > default signature resulting in pointer truncation (int). It's also
> > a good choice because the BSDs already have it.
> 
> Joseph, do you have any comment on this?

No.  The choice of whether something is included in _DEFAULT_SOURCE is a 
pragmatic one, since it's no longer defined based on a particular set of 
external APIs.  (Of course C++ code still gets _GNU_SOURCE whether it 
wants it or not, until we figure out how to allow libstdc++ to get 
everything its headers need under reserved names.)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list