From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id AC7263AAB42F for ; Fri, 11 Jun 2021 11:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC7263AAB42F Received: by mail-wr1-x431.google.com with SMTP id l2so5709534wrw.6 for ; Fri, 11 Jun 2021 04:32:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7MIsFZJ1pm23X9jZAW9fF7bdZxuGT7JOvq2Tou1wbrw=; b=ZcmT2Hb9uFYci0uXX8kvPKQRPN+rI2CGg9ospbmOVXRPWiGEICx3uL2zMcEmWhYhfO WKOokqF+/yTeK1mOtBt4WDq0+ATsAKLpCnmkWjPFXFnNOHdKlJn2linnwysn3ciUd28d 9xYnqkgf8prp3cOorkuEuuYey/4g9sUFlmHAV04H33SkGXbP+elUlE5FvbareqUxGZi9 +BAJ9CEBt+VTqtXrKe6S8meBPj2705q2ktsnp7c7InBtYX8u0GiIcZ1jBnm/FKJijUyG tcXfkQFZbD23Pgt63tQ8ET6udHQEqUH4Qs2AhYRN0u1wXDuqmKL2FKqlieC/xwXE0lo6 RZmw== X-Gm-Message-State: AOAM531PxIAFhP3lyUMM85aI9U/AyLOi28ifseI/JNZJJfpDHM4ejOWJ 88BrLLHkGcoRbCxbC1vMwu2x81S1U0z95ezvCSE= X-Google-Smtp-Source: ABdhPJyyyyhcOSOPa2y4xRL97Z77gp131KZA93yzev/vWWlpyQco3+3ni3M8fPCyxrof6scnyrwANS8SV+I/bXL//7Q= X-Received: by 2002:adf:de0e:: with SMTP id b14mr3406879wrm.321.1623411160856; Fri, 11 Jun 2021 04:32:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 11 Jun 2021 12:32:29 +0100 Message-ID: Subject: Re: gcc default standard To: Mehdi Megherbi Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 11:32:42 -0000 On Fri, 11 Jun 2021 at 10:17, Mehdi Megherbi via Gcc-help wrote: > > Hi > > I'm using ubuntu 20.04 and his default gcc version (9.3.0), with standard= C++14 as default. I have to compile from source a lot of scientific toolki= ts, all made with C++11. After a lot of research I was not able to find a w= ay to select the default standard of g++/gcc, so cmake/make take by default= the wrong standard and I get always crashs. Crashes? What is crashing? The toolkits you're compiling? GCC? Cmake? Do you just mean it doesn't compile, or is it compiling and then crashing when you run the software? Most C++11 code will compile without problems using -std=3Dgnu++14, so I'm not sure what the problem is. >There is really no intrensec way to select the default standard used ? No. Some makefiles will respect the CXXFLAGS variable, but not all. A brute force solution would be to create a wrapper script around gcc and g++ which always adds your preferred -std option and put that script earlier in your PATH than the real gcc executables: #!/bin/sh exec g++ "$@" -std=3Dgnu++11