https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 25 May 2021, harald at gigawatt dot nl wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 > > --- Comment #4 from Harald van Dijk <harald at gigawatt dot nl> --- > (In reply to Richard Biener from comment #3) > > Yes, including <stdlib.h> is enough to get the build to pass. My last point in > comment #2, however, means that that leaves things in an inconsistent state > and > that the right fix depends on what the project wants. There are basically two > options that look equally reasonable to me: adding an include of <cstdlib> > (and, although not required to fix the build, <cstdio>) and adding std:: > qualifiers to everything that needs it, or adding an include of <stdlib.h> > (and > <stdio.h>) and changing the other existing <c*> includes to <*.h>. Happy to > send a patch for whichever of these is preferred. At this point a minimal fix is prefered - in principle the file should be a valid source to any C++ 11 capable host compiler, not just GCC. The maintainer is on leave but we do want the build to be fixed. Now, since the file already includes csingal/cstring and cstdarg I'd say using the C++ wrapper to C includes and qualifying the calls would be consistent with existing use (thus not including stdlib.h but cstdlib).