autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Ignore boilerplate logo from MSVC on stderr.


From: Peter Rosin
Subject: [PATCH] Ignore boilerplate logo from MSVC on stderr.
Date: Mon, 16 Aug 2010 20:14:50 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Hi!

When configure checks if the compiler groks -g, it runs first
with -g and then without. MSVC (aka cl) only warns (on stderr)
about this unknown -g option, and does not return a non-zero
exit status. The -g test is rigged for this scenario, but there
is a quirk that the test does not cater for; MSVC always outputs
its boilerplate logo on stderr. This foils the test, as it does
not compare the stderr output from the two runs.

But instead of changing the test to actually compare the output
from the two runs, this patch carefully cuts out anything that
matches the logo closely enough.

The logo of my version of MSVC is:

----8<----
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

----8<----

Which I match with (in some quasi-regexp notation)

----8<----
Microsoft.*Optimizing Compiler.*
Copyright.*Microsoft Corporation.*
.\{0,1\}
----8<----

(but only if it matches the first three lines in stderr)

I don't know why I have to have the ".\{0,1\}" part of the regexp,
but I suspect that it has something to do with newline conversion
in MSYS. The 3rd line is empty, so that part should be empty
(which is why I wrote ".\{0,1\}" instead of "." in order to cope
in the event of the presumed bug eventually being fixed).

Note, you can work around this problem with the current test with
CC="cl -NOLOGO", but why require that?

Cheers,
Peter

Attachment: 0001-Ignore-boilerplate-logo-from-MSVC-on-stderr.patch.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]