From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A84A54EE2F for ; Fri, 13 Jun 2025 14:06:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 32ABB68C92E; Fri, 13 Jun 2025 17:06:04 +0300 (EEST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 9675268C27B for ; Fri, 13 Jun 2025 17:05:57 +0300 (EEST) Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-553b60de463so115027e87.3 for ; Fri, 13 Jun 2025 07:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1749823557; x=1750428357; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=RFrNaM2GMUK7mT0MQDgEr+NtcAgvLPJn/9l8Lk2n56M=; b=XyC5df1aQSZKlHE0duEcHYrwaBzYDSj95+vGeJe/BhYHfgOtiRfDK9peCdtdJSxXO/ CUC+josP6rXzbb9BzN1Dce/UI5dE3J4zejpWyzUJJjeHwdAOolqgCJ5soAFTKuZzQ9b5 OvV9QI6U/HRiHwaDWveIPDRecfsF1NNe+z0rKDyKNLF09vcPlvwiaquEPrK4vbB5sxjW XHB+J9mVXZk6Zg2lxrbjxB+zRTQ8xJPNCqS0xsj7alUYFGKNQd8J4OLLj7peoaFyFDaf E7YM0M2RIAGac7iOjupibAXPyMGYUTPX6jrRIJ/lXp99n5WumsbeLQFS3Bk9gVhMGf2p I06g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749823557; x=1750428357; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RFrNaM2GMUK7mT0MQDgEr+NtcAgvLPJn/9l8Lk2n56M=; b=CU0ijYiFs8HFUZWhi6Q8qnTvmmk5Wwgdzv38+9KsA67WN2r7fa97DyB+9OacDNWQJz hRjYh0ZGzl79d7Ys1+WmgRhq70vSFbaNVaLjRd2vNJOBWmRLHtXl7pZza+vZKKrT2QYk 2FXDPXAdnsWCke5YKMSaQQRBK74DXZ4eAFJeqDAkMgD3SbKZUsFp+Vyd6O1tn+tkCN5v Y9S2WWdAmZsg0y8ydFgVis71uZLHdeYAXI37ap4QsUH+OJ8/gblQbtb+t9oy7mrxJhBM e6h8Cv1KJ90UcT05u443mzawxzwSBnDHRY14y8M5d8v2dDesZmBUTtGyzcsvHAd6vtIw Z8Iw== X-Gm-Message-State: AOJu0YzvDWQgEzpgqAGhGPQrPxQZyclvM/o0ECsISlVEY9fCv8IvZ3p3 E3d/RTB3je4aRiCKI1SfMBp0MenfeZQASl/GuBZFTdm1GT+cFeu8FyCYlkRHnrTteZ/L1WNXYg2 dG4U0GA== X-Gm-Gg: ASbGncspliEGLFsDwrfsCYJMKXOmtuDX0W08hbHeACgTc96yM0oRHS21RKLJs7FftIF DGrUMihz0CDQ81xmUxMHt5mV0qMCV8cTDMvI3M5Ox4P44kAloEHdQDQP+xsUnPiYy7mx8AVYz1I f9jCUXSUhbwUGtD3UIqYVhUlZLiPLSAROcxIwufoLcqdgfo+hWaYtZUX1Ywp7u3Fen0vvNW/JgR 7TZftkIdYnXZwDBRG0M/Ffc+KyH9ldmFOaM9LMZQW/uo+ukcWzR8gqjJ5f91PF9dklksbDty65B XLbj8ALRn4y11zv6+hrxhss0I7qvqsgHOhjgDriAG7075QN96oXINQ/WmRaBhILgGzORQspK6bb jyWzkiYJshvzYZ1CsLK6JHvy4Kt9F X-Google-Smtp-Source: AGHT+IFj6191V8rwB+SfkcppR1nOk11duWJsoM0RNU2p+g3uIhh5ch2pcV4FrZyXWoC4rNSQsokZEw== X-Received: by 2002:a05:6512:690:b0:553:241d:4e77 with SMTP id 2adb3069b0e04-553af950e6bmr904621e87.22.1749823556242; Fri, 13 Jun 2025 07:05:56 -0700 (PDT) Received: from localhost (dsl-tkubng21-50de30-198.dhcp.inet.fi. [80.222.48.198]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-553ac11687asm461258e87.30.2025.06.13.07.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jun 2025 07:05:55 -0700 (PDT) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Jun 2025 17:05:52 +0300 Message-ID: <20250613140555.121374-1-martin@martin.st> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] configure: Make MSVC version grabbing more robust X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: When running plain "cl", to get the MSVC version, it prints the version header on stderr, while the usage instructions are printed on stdout. Usually, the version on stderr gets flushed first, so "head -n1" gets the line it expects, but some times (in particular when running MSVC wrapped in wine), it can get the usage line first. Redirect stdout to /dev/null, so we only grab the version among the lines printed to stderr. This should make the version number grabbing more robust. At least all relevant versions of MSVC seem to print this specifically to stderr, not stdout (so we don't risk to miss it); checked down to MSVC 2010. --- This should avoid the occasionally misdetected version number lines as seen at https://fate.ffmpeg.org/history.cgi?slot=x86_64-msvc2022-wine. --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 534b443f7d..98a3b3814f 100755 --- a/configure +++ b/configure @@ -5127,7 +5127,10 @@ probe_cc(){ elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then _type=msvc if $_cc -nologo- 2>&1 | grep -q Microsoft; then - _ident=$($_cc 2>&1 | head -n1 | tr -d '\r') + # The version number is printed on the first line on stderr, stdout + # gets the usage instructions. Only include stderr, to avoid + # potential ordering race conditions. + _ident=$($_cc 2>&1 >/dev/null | head -n1 | tr -d '\r') else _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r') fi -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".