Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DD44C4338F for ; Sat, 7 Aug 2021 02:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAE4661167 for ; Sat, 7 Aug 2021 02:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbhHGCPk (ORCPT ); Fri, 6 Aug 2021 22:15:40 -0400 Received: from cloud.peff.net ([104.130.231.41]:41676 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhHGCPk (ORCPT ); Fri, 6 Aug 2021 22:15:40 -0400 Received: (qmail 17553 invoked by uid 109); 7 Aug 2021 02:15:23 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Aug 2021 02:15:23 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 16884 invoked by uid 111); 7 Aug 2021 02:15:24 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 06 Aug 2021 22:15:24 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 6 Aug 2021 22:15:22 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: Junio C Hamano , git@vger.kernel.org, Carlo Marcelo Arenas =?utf-8?B?QmVsw7Nu?= Subject: Re: [PATCH v2 0/3] detect-compiler: clang updates Message-ID: References: <20210806205235.988761-1-gitster@pobox.com> <87bl6aypke.fsf@evledraar.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bl6aypke.fsf@evledraar.gmail.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, Aug 07, 2021 at 04:02:45AM +0200, Ævar Arnfjörð Bjarmason wrote: > Perhaps I've missed some obvious reason not to do this, but why are we > parsing the --version output of two modern compilers, as opposed to just > asking them what type/version they are via their usual macro facilities? > I.e. something like the below: That would probably work OK in practice, but it actually seems more complex to me (how do other random compilers react to "-E -"? Is it possible for us to get other output from the preprocessor that would confuse an eval?). It could perhaps make the Apple version-string confusion go away, though, which might make it worth doing. -Peff