{"id":2221308,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2221308/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/20260409075634.4300C4BA2E31@sourceware.org/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260409075634.4300C4BA2E31@sourceware.org>","date":"2026-04-09T07:56:07","name":"[14] build: Move sstream and memory include above safe-ctype.h [PR124830]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5328d576b8747d58534fb69279192103d7c8a6b4","submitter":{"id":4338,"url":"http://patchwork.ozlabs.org/api/1.1/people/4338/?format=json","name":"Richard Biener","email":"rguenther@suse.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/20260409075634.4300C4BA2E31@sourceware.org/mbox/","series":[{"id":499249,"url":"http://patchwork.ozlabs.org/api/1.1/series/499249/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=499249","date":"2026-04-09T07:56:07","name":"[14] build: Move sstream and memory include above safe-ctype.h [PR124830]","version":1,"mbox":"http://patchwork.ozlabs.org/series/499249/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221308/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221308/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=fpJWn8pE;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=1yZTPLhu;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=fpJWn8pE;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=1yZTPLhu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=fpJWn8pE;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=1yZTPLhu;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=fpJWn8pE;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=1yZTPLhu","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=suse.de","sourceware.org; spf=pass smtp.mailfrom=suse.de","server2.sourceware.org;\n arc=none smtp.remote-ip=195.135.223.130","smtp-out1.suse.de;\n\tnone"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frshN20N2z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 17:56:36 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 4300C4BA2E31\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  9 Apr 2026 07:56:34 +0000 (GMT)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n by sourceware.org (Postfix) with ESMTPS id 7E0284BA2E09\n for <gcc-patches@gcc.gnu.org>; Thu,  9 Apr 2026 07:56:08 +0000 (GMT)","from murzim.nue2.suse.org (unknown [10.168.4.243])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id 6F9794EE17;\n Thu,  9 Apr 2026 07:56:07 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 4300C4BA2E31","OpenDKIM Filter v2.11.0 sourceware.org 7E0284BA2E09"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 7E0284BA2E09","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 7E0284BA2E09","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775721368; cv=none;\n b=qIrQSkPph8DoN+TIkG9CGsGQsY50XMHKWLR1EOFLNDbX9jtgPN+KXJxhUlvGLkkgIv+ezDPkt84+p8/7sTlhsSB1UQu8OK3KCZH+Jt4hBtHpFT+6A9cfzjWuwYiiUVMNRltV/WfMZ0mvmxjPFqd43DptvIMUWglWXz5uokzo7Ec=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775721368; c=relaxed/simple;\n bh=B71t8OFCLP4kZm4Y0AZKjd6PZ0QyWQ3cikHs68Y4kYQ=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:MIME-Version;\n b=ZqlxfDHxQMfe2FV+vUBe6FFzJpzdFUspLAjh8HzO5qVNiNQ3RcdhmuRWdWrEo7FtTp+TwckzLOT7S9IajHmziYotw1jx3bPfMBWG1L3059h535al9Z4n7nHkiFv//UiyaB3JjZDHFpUUtbvYGeIwYNdYlKIqxoW7tfvZZ/xNRjw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1775721367;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=XOZSRTo4uh7TXIJdxPrbEAC4Dpx1E8TYY2jEMe8X/hk=;\n b=fpJWn8pErAh4aSA0ofzbDFjVEMjTIfrX9TwXvmdbXxL8ZjoIQFPzfjvj/AFkTCiQf2LfoL\n nNKaHK8n27JGlMqECQoU63I69keJNwM87AXKrrsJsb+Dj1lxikdU21O77QJ3vUTSYg2ucW\n ftcthlHp8+oTj4THT0t8qcvlUFXrXc0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1775721367;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=XOZSRTo4uh7TXIJdxPrbEAC4Dpx1E8TYY2jEMe8X/hk=;\n b=1yZTPLhuclDO9EghmnkQXnc8yE/IGryXnYUQRimo8zAS89dvb7fmrf3O49Lzg4FcJEUDeM\n Y4misp2cd5ETUwDQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1775721367;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=XOZSRTo4uh7TXIJdxPrbEAC4Dpx1E8TYY2jEMe8X/hk=;\n b=fpJWn8pErAh4aSA0ofzbDFjVEMjTIfrX9TwXvmdbXxL8ZjoIQFPzfjvj/AFkTCiQf2LfoL\n nNKaHK8n27JGlMqECQoU63I69keJNwM87AXKrrsJsb+Dj1lxikdU21O77QJ3vUTSYg2ucW\n ftcthlHp8+oTj4THT0t8qcvlUFXrXc0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1775721367;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=XOZSRTo4uh7TXIJdxPrbEAC4Dpx1E8TYY2jEMe8X/hk=;\n b=1yZTPLhuclDO9EghmnkQXnc8yE/IGryXnYUQRimo8zAS89dvb7fmrf3O49Lzg4FcJEUDeM\n Y4misp2cd5ETUwDQ=="],"Date":"Thu, 9 Apr 2026 09:56:07 +0200 (CEST)","From":"Richard Biener <rguenther@suse.de>","To":"gcc-patches@gcc.gnu.org","cc":"quic_apinski@quicinc.com","Subject":"[PATCH][14] build: Move sstream and memory include above safe-ctype.h\n [PR124830]","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","X-Spamd-Result":"default: False [-1.79 / 50.00]; BAYES_HAM(-3.00)[99.99%];\n MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.19)[-0.973]; MIME_GOOD(-0.10)[text/plain];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; MISSING_XM_UA(0.00)[];\n ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2];\n TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n MIME_TRACE(0.00)[0:+]","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org","Message-Id":"<20260409075634.4300C4BA2E31@sourceware.org>"},"content":"From: Andrew Pinski <quic_apinski@quicinc.com>\n\nThis picks r15-5661-gf6e00226a4ca6 to older branches, also moving\nthe <memory> include to fix build issues with a C++20 host compiler.\n\nsstream in some versions of libstdc++ include locale which might not have been\nincluded yet. safe-ctype.h defines the toupper, tolower, etc. as macros so the\nc++ header files needed to be included before hand as comment in system.h says:\n/* Include C++ standard headers before \"safe-ctype.h\" to avoid GCC\n   poisoning the ctype macros through safe-ctype.h */\n\nI don't understand how it was working before when memory was included after\nsafe-ctype.h rather than before. But this makes sstream consistent with the\nother C++ headers.\n\nBuilt with C++20 and non-C++20 host compiler and pushed to the 14\nbranch.  I'll do the same to 13 after verifying in the same way.\n\nRichard.\n\ngcc/ChangeLog:\n\n\tPR target/117771\n\tPR c/124830\n\t* system.h: Move the include of sstream and memory above safe-ctype.h.\n\nSigned-off-by: Andrew Pinski <quic_apinski@quicinc.com>\n---\n gcc/system.h | 21 +++++++++------------\n 1 file changed, 9 insertions(+), 12 deletions(-)","diff":"diff --git a/gcc/system.h b/gcc/system.h\nindex b18482c7190..da331f105ba 100644\n--- a/gcc/system.h\n+++ b/gcc/system.h\n@@ -222,6 +222,15 @@ extern int fprintf_unlocked (FILE *, const char *, ...);\n #ifdef INCLUDE_FUNCTIONAL\n # include <functional>\n #endif\n+#ifdef INCLUDE_SSTREAM\n+# include <sstream>\n+#endif\n+/* Some of the headers included by <memory> can use \"abort\" within a\n+   namespace, e.g. \"_VSTD::abort();\", which fails after we use the\n+   preprocessor to redefine \"abort\" as \"fancy_abort\" below.  */\n+#ifdef INCLUDE_MEMORY\n+# include <memory>\n+#endif\n # include <cstring>\n # include <initializer_list>\n # include <new>\n@@ -758,22 +767,10 @@ private:\n #define LIKELY(x) (__builtin_expect ((x), 1))\n #define UNLIKELY(x) (__builtin_expect ((x), 0))\n \n-/* Some of the headers included by <memory> can use \"abort\" within a\n-   namespace, e.g. \"_VSTD::abort();\", which fails after we use the\n-   preprocessor to redefine \"abort\" as \"fancy_abort\" below.  */\n-\n-#ifdef INCLUDE_MEMORY\n-# include <memory>\n-#endif\n-\n #ifdef INCLUDE_MUTEX\n # include <mutex>\n #endif\n \n-#ifdef INCLUDE_SSTREAM\n-# include <sstream>\n-#endif\n-\n #ifdef INCLUDE_MALLOC_H\n #if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)\n #include <malloc.h>\n","prefixes":["14"]}