<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -dumpversion commandline option useless"
href="https://llvm.org/bugs/show_bug.cgi?id=25211">bug 25211</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>rnk@google.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -dumpversion commandline option useless"
href="https://llvm.org/bugs/show_bug.cgi?id=25211#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -dumpversion commandline option useless"
href="https://llvm.org/bugs/show_bug.cgi?id=25211">bug 25211</a>
from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
<pre>This is legacy of clang pretending to be GCC 4.2.1, if you weren't aware.
There's a relevant comment in the code that implements it:
if (C.getArgs().hasArg(options::OPT_dumpversion)) {
// Since -dumpversion is only implemented for pedantic GCC compatibility,
we
// return an answer which matches our definition of __VERSION__.
//
// If we want to return a more correct answer some day, then we should
// introduce a non-pedantically GCC compatible mode to Clang in which we
// provide sensible definitions for -dumpversion, __VERSION__, etc.
llvm::outs() << "4.2.1\n";
return false;
}
I don't think we can change -dumpversion directly, since most existing
makefiles probably expect a GCC version number. We could add a
-dump-clang-version flag or somesuch, but I feel like we already have ways of
getting this, like 'clang --version' or 'clang -dM -E -x c /dev/null | grep
clang_version', which gives:
#define __clang_version__ "3.8.0 (trunk 250112) (llvm/trunk 250108)"
Given that there are existing ways to get this information, I think this is
already working.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>