From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6P+3GUy6M2dcSQAAe85BDQ:P1 (envelope-from ) for ; Tue, 12 Nov 2024 20:27:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6P+3GUy6M2dcSQAAe85BDQ (envelope-from ) for ; Tue, 12 Nov 2024 21:27:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=OBuT0CmG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731443276; a=rsa-sha256; cv=none; b=AWrZAfeNuxsP7ifwS6/LCyvYgWMmxv0B9vgHszx9xfKEBTWzOBZKvkISfG/5EBELnakFqW Q4boqYRjdIckXhiQuxVYjys3LyOfl4FGMGrKpc3JjLFuB8TSwCAa8Tgbl0/E4CWhcHTmk5 6EE76eo62f7GvK1vI6jYPJ26azuLng926tOfgCB88BK+ajq9EidK76xcLp/6h0ZoYSqYGS pKPQCRAL0GbGXfXdY1Q+VdfoxcF1GlK5z65KkUkyJ5NCC1FDwk5qxzLNpNNt4HRUuPwJ2V QLNN3UHjhfcHzNzWdmPjk4fK4B6LBLz2ZnrWF6ouvFTYtgINELwJOWjuGV9Mow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=OBuT0CmG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731443276; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=pUCxfTIdDlA+x6Lj2UNiUvj2rZzaoj9lvvmS42wNPec=; b=Fr53CGE+8BK0Rxw49t4Ue8KZ2LmMcI+BdFe5q1xx2NYa/XfrYSG073hsnOiLK/rG3TPL6c 8N1kvng58zACbOek+anRrRDpOzz9i36ggrYSNFG20Vl5oH8iqflabt8UXCEZPtJPzO1eic 4uMLS4eVMI3ETma6o9RiYrGXIGjSLZGb7FUnPi6PpfFUMJkf60vQL0/rESNqiR2PWlAz5c t3etP95Yw9j/yjpbx2egrGyU0AWi+Lq4xvkhWd+L3DhZRm2Emj+h3IrdPlYsxYYgUebgaF jSxBK0fkmm5BW52XeJ86zM0lhY/67WorRTqY/3Z/eIxQzHqHDkcyTy1LX11SAQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EF44689258 for ; Tue, 12 Nov 2024 21:27:55 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAxTt-0007jp-Nx; Tue, 12 Nov 2024 15:27:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAxTr-0007jN-NF for help-guix@gnu.org; Tue, 12 Nov 2024 15:27:19 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAxTk-0007UL-CK for help-guix@gnu.org; Tue, 12 Nov 2024 15:27:14 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2e3686088c3so4775309a91.0 for ; Tue, 12 Nov 2024 12:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731443231; x=1732048031; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pUCxfTIdDlA+x6Lj2UNiUvj2rZzaoj9lvvmS42wNPec=; b=OBuT0CmGuWaS4eBYQCFsfTk5mPt/3obcsnHBy+lc6t6yLhmGaFjb6bwFM+wHwXtbXf JaLYEm7BDtl/jQDx/QYYEp9n+ZThWEDteoG8Q7gkvY4PD/5u2MiN39KeXr3XszxzgU2x 5o7zWfxq93sJqcucy483Fnz2+4trEJtMzld4sckzFyyBzBEFI48X0mk0TKE6H46jCxSg ci1gzGe2HEuud+8JoRAcB3x611EytH+b5dl3S9yo1NLntN4Si4GPFEXV6AJ13uaONIip 1iMOGIZwoJtRJABpwG1v5C73hirbMRr1v8cE5edfnTILWFogYrSIe4fk1uxo0MJ6yUOx iGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731443231; x=1732048031; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pUCxfTIdDlA+x6Lj2UNiUvj2rZzaoj9lvvmS42wNPec=; b=ETeOT/m67WASGjXXRouVWNnYMXpb2BB6igTWwXSZ+eXneiEEx5Ta+mgRtPLPNyQnFA cjr9ft+q87vq3k+dtyteZEA6yLDeDZgPJxtVRb3WeqCSfGORdeu4EzXTyzli8VGWVPXV ilE9XIe52tr4mO3+OeIvpuGpwFsjteAJhAkVseQrhKEf/QYIZ/l3E8dVR/NDRn7Pavfp 1HvmtyhiGcUGRbFHYyIX1NR+bCxkG1aUy5aLpfo+chEbUm5DOgz+Xwv77z+GuO+ZuBo6 V00if0cgQQ+E9xLyjsPNcoRolVFcvbVCx7GQ0shk+FcKEsDeCVhpR5aaB14cvN8J8TuO d5dA== X-Gm-Message-State: AOJu0Yz3fDr53gY4vFi1HUCgh6gQ/HM1q/U6k6zCnHCU2xHwt2P1Mphq 3weWwfDNecOJEPzPYeKfjFI0uAfQsawF8EEexQ6V8hrHV7Jml86x5dxluYmYgBpxl0uBai8tufv oQa2DhJf9ttZui4Ut+9OUo+aknyCqjw98 X-Google-Smtp-Source: AGHT+IGJB7iFWlKvHRmQmdfglr3XsouE1LtNuhrPGfWb2f6ERWlbYUbYfR2/mp/gBmUhhq8GgncUCjOlJwALpqXYbCY= X-Received: by 2002:a17:90b:3b85:b0:2dd:5e86:8c2f with SMTP id 98e67ed59e1d1-2e9e4bef591mr5234141a91.21.1731443230751; Tue, 12 Nov 2024 12:27:10 -0800 (PST) MIME-Version: 1.0 References: <87a5e42v95.fsf@posteo.net> In-Reply-To: <87a5e42v95.fsf@posteo.net> From: Laurent Gatto Date: Tue, 12 Nov 2024 21:26:44 +0100 Message-ID: Subject: Re: C++ error To: Fredrik Salomonsson Cc: help-guix@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=laurent.gatto@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.36 X-Spam-Score: -5.36 X-Migadu-Queue-Id: EF44689258 X-Migadu-Scanner: mx10.migadu.com X-TUID: nOkF+kDhVh/l Hi Fredrik, Thank you for taking the time looking into this. My issue doesn't seem to be related to an old gcc version. ``` $ g++ --version g++ (GCC) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` My location is different though ``` $ which g++ /home/lgatto/.guix-profile/bin/g++ ``` Checking the stdc++ lib: ``` $ sed -n '3154p' ~/.guix-profile/include/c++/type_traits _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead") ``` And the gcc search paths on my machine: ``` $ echo | g++ -E -Wp,-v - ignoring nonexistent directory "/no-gcc-local-prefix/include" ignoring nonexistent directory "/gnu/store/ikn0imxfc6n0ba12mrf0c4hc1jm7ylc7-gcc-14.2.0-lib/lib/gcc/x86_64-= unknown-linux-gnu/14.2.0/../../../../../../../x86_64-unknown-linux-gnu/incl= ude" ignoring duplicate directory "/home/lgatto/.guix-profile/include" as it is a non-system directory that duplicates a system directory #include "..." search starts here: #include <...> search starts here: /home/lgatto/.guix-profile/include /gnu/store/ikn0imxfc6n0ba12mrf0c4hc1jm7ylc7-gcc-14.2.0-lib/lib/gcc/x86_64-= unknown-linux-gnu/14.2.0/include /gnu/store/ikn0imxfc6n0ba12mrf0c4hc1jm7ylc7-gcc-14.2.0-lib/lib/gcc/x86_64-= unknown-linux-gnu/14.2.0/include-fixed /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/include End of search list. # 0 "" # 0 "" # 0 "" # 1 "/home/lgatto/.guix-profile/include/stdc-predef.h" 1 3 # 0 "" 2 # 1 "" ```` Except for the version and location, all this looks very similar to what you have, which leaves me quite puzzled. Laurent On Tue, 12 Nov 2024 at 18:54, Fredrik Salomonsson wro= te: > > Hi, > > Laurent Gatto writes: > > > Dear all, > > > > I have this very simple code chunk > > > > $ cat main.cpp > > #include > > > > int main(void) { > > std::cout << __cplusplus; > > > > return 0; > > } > > > > That I can compile in a minimal shell > > > > $ guix shell --container gcc-toolchain > > [env]$ g++ main.cpp && ./a.out > > 201703 > > > > However, on my main system, I get > > > > $ g++ main.cpp > > In file included from /home/lgatto/.guix-profile/include/c++/bits/move.= h:57, > > from > > /home/lgatto/.guix-profile/include/c++/bits/exception_ptr.h:43, > > from /home/lgatto/.guix-profile/include/c++/exception:= 153, > > from /home/lgatto/.guix-profile/include/c++/ios:39, > > from /home/lgatto/.guix-profile/include/c++/ostream:38= , > > from /home/lgatto/.guix-profile/include/c++/iostream:3= 9, > > from main.cpp:1: > > /home/lgatto/.guix-profile/include/c++/type_traits:732:26: error: > > expected identifier before =E2=80=98(=E2=80=99 token > > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > > is_trivial instead") > > | ^ > > /home/lgatto/.guix-profile/include/c++/type_traits:732:27: error: > > expected unqualified-id before string constant > > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > > is_trivial instead") > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~ > > /home/lgatto/.guix-profile/include/c++/type_traits:732:27: error: > > expected =E2=80=98)=E2=80=99 before string constant > > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > > is_trivial instead") > > | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~ > > | ) > > /home/lgatto/.guix-profile/include/c++/type_traits:3154:25: error: > > expected unqualified-id before string constant > > 3154 | _GLIBCXX20_DEPRECATED("use is_standard_layout_v && > > is_trivial_v instead") > > | > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/lgatto/.guix-profile/include/c++/type_traits:3154:25: error: > > expected =E2=80=98)=E2=80=99 before string constant > > 3154 | _GLIBCXX20_DEPRECATED("use is_standard_layout_v && > > is_trivial_v instead") > > | > > ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > | ) > > > > > > Other issues lead me to suspect that I lost support for C++17 and beyon= d. > > > > Any idea what/how I messed up and how to fix this? > > What version is gcc on your main system? Could be that you somehow are > running an older gcc than what's in that .guix-profile. > > I could compile that example just fine on mine. > > Here is how g++ looks like on my machine, maybe that will help. Note > that I'm using guix home to install gcc-toolchain. > > The version I'm using: > ``` > $ g++ --version > g++ (GCC) 11.4.0 > Copyright (C) 2021 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is N= O > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS= E. > ``` > > From where I'm picking up g++ from: > ``` > $ which g++ > /home/plattfot/.guix-home/profile/bin/g++ > ``` > > Checking the stdc++ lib: > ``` > $ sed -n '3154p' ~/.guix-home/profile/include/c++/type_traits > _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead= ") > ``` > Which matches what you have. > > Here is the search paths gcc uses on my machine: > > ``` > $ echo | g++ -E -Wp,-v - > ignoring nonexistent directory "/no-gcc-local-prefix/include" > ignoring nonexistent directory "/gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj= 16-gcc-11.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.4.0/../../../../../..= /../x86_64-unknown-linux-gnu/include" > #include "..." search starts here: > #include <...> search starts here: > /home/plattfot/.guix-home/profile/include > /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/gcc/x86_6= 4-unknown-linux-gnu/11.4.0/include > /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/gcc/x86_6= 4-unknown-linux-gnu/11.4.0/include-fixed > /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/include > End of search list. > # 0 "" > # 0 "" > # 0 "" > # 1 "/home/plattfot/.guix-home/profile/include/stdc-predef.h" 1 3 > # 0 "" 2 > # 1 "" > ``` > -- > s/Fred[re]+i[ck]+/Fredrik/g