From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by sourceware.org (Postfix) with ESMTPS id 85BCA3858C3A for ; Thu, 12 Oct 2023 17:11:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85BCA3858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3247cefa13aso1088617f8f.1 for ; Thu, 12 Oct 2023 10:11:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697130662; x=1697735462; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZgQ0Y8ZJ86h1urxL3Sv0ryfgxVZFfCeoDrSKUZz1ljA=; b=b2vfufoW9G6L8Eknwjy4kc1N20ZyzDKeDfTWJSrZuagClOXa05b+sceZFVVup9fw18 v/Tr9kidxoJr7R3am9bbmZQH0Mcx/pyjKotuK9/GFuJ9GhMuu/GmJw6NfPHwnunlXagO WYbJ0CvI+eoLVe0oiXnN972vIrlOQPujLX0D7G3klqlzBKyalxVMRunc+QmN64lCqtIU uRNWAleIz/QZ5AGDzyF2bY8C141DuecSSd/w8d9e+WQWYLJdhJa/gct4YChiG8gZzubK 7qFiaWrfJ1EKd4+HhtMUqb9M78cJyZS1KqO4xgItwi1DIIReJcxE6OCqitnAQTRVFdeV mpSQ== X-Gm-Message-State: AOJu0YwkVet77Y+uPCaR23Wd4wl+deofviFICSDWU3Io2N1h3HfDQuBO 2R7UvmhudNBaP4AHhQuJ09kMb5UgjEuGAw== X-Google-Smtp-Source: AGHT+IF1liPQMurRrylkL2V1Pp7OIoKkSaVV0AYm+m4ScNZvUo30wBNb37Qncel0I9PLFfMLTYc6Zw== X-Received: by 2002:adf:f80d:0:b0:31f:fedd:83ad with SMTP id s13-20020adff80d000000b0031ffedd83admr21031904wrp.4.1697130662123; Thu, 12 Oct 2023 10:11:02 -0700 (PDT) Received: from ?IPV6:2001:8a0:f939:d200:dedd:c263:b7d3:9ba1? ([2001:8a0:f939:d200:dedd:c263:b7d3:9ba1]) by smtp.gmail.com with ESMTPSA id w16-20020adf8bd0000000b0032d81837433sm6121466wra.30.2023.10.12.10.11.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 10:11:01 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2023 18:10:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] [gdb/build] Require c++17 compiler Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20231005065449.32643-1-tdevries@suse.de> From: Pedro Alves In-Reply-To: <20231005065449.32643-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-10-05 07:54, Tom de Vries via Gdb-patches wrote: > Since gdb 8.0, we've required a c++11 compiler. > > That allowed gdb to be compiled with gcc releases as far back as gcc 4.8, > using an explicit -std=c++11 to override the default. > > [ Gcc has the following defaults: > - before gcc 6: c++98, and > - for gcc 6-10: c++14, and > - since gcc 11: c++17. ] > Just a comment here: > There are two arguments in favor of moving to requiring a newer c++ standard: > - benefits can be had from using newer c++ features. We're already using some > of those features using gdb-specific implementations. ... > - when developing gdb on modern platforms with system compiler gcc >= 6, > people can accidentally use c++14/c++17 features in a patch, only to find out > post-commit that it breaks the build on a system with a compiler that only > supports c++11, which is inconvenient and takes time to fix. > [ This could be partially mitigated by if possible also forcing -std=c++11 > for such compilers. ] Whether to force -std=c++11 to avoid this had been discussed back in the C++11 transition as well, and we decided against back then. The benefit of being able to conditionally use newer C++ features, which may e.g., be a lot more efficient, or the making sure our replacements don't deviate from actual standard components (by actually using them when possible), outweighs the rare breakage concern, IMHO.