[llvm-bugs] [Bug 25211] -dumpversion commandline option useless
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Oct 16 10:52:49 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=25211
Reid Kleckner <rnk at google.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |rnk at google.com
Resolution|--- |INVALID
--- Comment #1 from Reid Kleckner <rnk at google.com> ---
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151016/84a32221/attachment.html>
More information about the llvm-bugs
mailing list