[LLVMbugs] [Bug 15610] New: -Wunused-macros warns despite line markers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 27 07:14:29 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15610

            Bug ID: 15610
           Summary: -Wunused-macros warns despite line markers
           Product: clang
           Version: 3.2
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: l.lunak at suse.cz
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

-Wunused-macros warns about unused macros even if line markers say it is not
actually from the main file:

$ cat a.cpp
#define FOO
# 1 "b.cpp" 1
#define BAR

$ g++ -Wunused-macros a.cpp -c
a.cpp:3:0: warning: macro "FOO" is not used [-Wunused-macros]

$ clang++ -Wunused-macros a.cpp -c
a.cpp:1:9: warning: macro is not used [-Wunused-macros]
#define FOO
        ^
In file included from a.cpp:2:
b.cpp:1:9: warning: macro is not used [-Wunused-macros]
#define BAR
        ^
2 warnings generated.

The warning about BAR is unwanted (e.g. in cases the source file comes
preprocessed in some way, such as -frewrite-includes).

-- 
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/20130327/fd5857e5/attachment.html>


More information about the llvm-bugs mailing list