[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #11 from CVS Commits --- The releases/gcc-11 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:742b4b7a644dbb4dd4a5f26c91380db826a6de07 commit r11-8491-g742b4b7a644dbb4dd4a5f26c91380db826a6de07 Author: Jakub Jelinek Date: Tue May 25 16:44:35 2021 +0200 c++tools: Include for exit [PR100731] This TU uses exit, but doesn't include or and relies on some other header to include it indirectly, which apparently doesn't happen on reporter's host. The other headers aren't guarded either and we rely on a compiler capable of C++11, so maybe we can rely on being around unconditionally. 2021-05-25 Jakub Jelinek PR bootstrap/100731 * server.cc: Include . (cherry picked from commit 7a5e9a58fbe27d8b8f04cd18bc6e1dd736e3cd12)
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #10 from Jakub Jelinek --- I plan to add the std:: qualifications, but committed the above patch because it works likely everywhere and has been tested already.
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #9 from Jonathan Wakely --- r230324 changed the dependency for std::to_string from _GLIBCXX_USE_C99 to _GLIBCXX_USE_C99_STDIO, which means it's enabled for more targets (you don't need the full C99 math library, for example!) That change is present in GCC 6. And r272186 removed the _GLIBCXX_C99_STDIO dependency for std::to_string, so it's always defined now. That's in GCC 10.
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #8 from Harald van Dijk --- I take it that means there's no need for me to continue with what Richard asked me to do? At any rate, it looks like this fix won't be enough for GCC 12, but that's an issue with the environment, not GCC 12. In !_GLIBCXX_USE_C99 environments, there is always going to be valid C++11 code that will be rejected and it looks like GCC 12 started using at least one std::to_string that relies on C99 in the underlying C library. If C++11 is a bootstrap requirement, that's fair enough, that means I need to update my environment at some point before GCC 12 will be released.
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #7 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:7a5e9a58fbe27d8b8f04cd18bc6e1dd736e3cd12 commit r12-1041-g7a5e9a58fbe27d8b8f04cd18bc6e1dd736e3cd12 Author: Jakub Jelinek Date: Tue May 25 16:44:35 2021 +0200 c++tools: Include for exit [PR100731] This TU uses exit, but doesn't include or and relies on some other header to include it indirectly, which apparently doesn't happen on reporter's host. The other headers aren't guarded either and we rely on a compiler capable of C++11, so maybe we can rely on being around unconditionally. 2021-05-25 Jakub Jelinek PR bootstrap/100731 * server.cc: Include .
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #6 from Harald van Dijk --- (In reply to rguent...@suse.de from comment #5) > 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). The minimal fix is the other one, to change the headers to <*.h>, as none of the calls to library functions in the file are std::-qualified. :) Alright, I'll send a patch for that once I'm able to test that the same problem is still present on master and that the same fix is sufficient to get things working.
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #5 from 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 --- > (In reply to Richard Biener from comment #3) > > Yes, including 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 > (and, although not required to fix the build, ) and adding std:: > qualifiers to everything that needs it, or adding an include of > (and > ) and changing the other existing 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).
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 --- Comment #4 from Harald van Dijk --- (In reply to Richard Biener from comment #3) Yes, including 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 (and, although not required to fix the build, ) and adding std:: qualifiers to everything that needs it, or adding an include of (and ) and changing the other existing includes to <*.h>. Happy to send a patch for whichever of these is preferred.
[Bug c++/100731] [11/12 Regression] GCC 11 fails to build using GCC 4.8 because of missing includes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100731 Richard Biener changed: What|Removed |Added Summary|GCC 11 fails to build using |[11/12 Regression] GCC 11 |GCC 4.8 because of missing |fails to build using GCC |includes|4.8 because of missing ||includes CC||nathan at gcc dot gnu.org, ||rguenth at gcc dot gnu.org Target Milestone|--- |11.2 Priority|P3 |P2 --- Comment #3 from Richard Biener --- Since you can test a build with uclibc, can you possibly come up with a (minimal) patch to make the build work? It sounds like amending // OS #include #include #include #include with #include should do the trick? Can you possibly post such patch to gcc-patc...@gcc.gnu.org stating how you tested it? Thanks.