[LLVMbugs] [Bug 12643] New: Clang reports its own version incorrectly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 24 08:05:00 PDT 2012


             Bug #: 12643
           Summary: Clang reports its own version incorrectly
           Product: clang
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: l.lunak at suse.cz
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Steps to reproduce:

$ clang++ --version
clang version 3.1 
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ cat /tmp/a.cpp
__clang_major__ . __clang_minor__ . __clang_patchlevel__

$ clang++ -E /tmp/a.cpp
# 1 "/tmp/a.cpp"
# 1 "/tmp/a.cpp" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 145 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/tmp/a.cpp" 2
3 . 1 . 0

This is obviously wrong. Version 3.1.0 has been barely branched, let alone
released. And this does not apply only to development snapshots, but I've been
told that Apple's current XCode does this too and Clang identifies itself as
"3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)".

A specific case of where this is wrong is checking for compiler bugs. For
example, until recently there had been no simple way to check which command
line options clang supports, because even with -Werror Clang just warned about
unknown arguments but proceeded anyway. This will be fixed in the 3.1.0
release, but there is no way to actually identify such release.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list