[llvm-bugs] [Bug 24424] New: Too much information printed in macro diagnostic message

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 10 18:33:08 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24424

            Bug ID: 24424
           Summary: Too much information printed in macro diagnostic
                    message
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: ASSIGNED
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhengkai at google.com
                CC: llvm-bugs at lists.llvm.org, rtrieu at google.com
            Blocks: 24423
    Classification: Unclassified

#define F(x) x + 1
#define NO_INITIATION(x) int a = F(x) * 2

NO_INITIATION(a);

Should print:
reduced-diags-macros.cpp:7:15: warning: variable 'a' is uninitialized when used
within its own initialization [-Wuninitialized]
NO_INITIATION(a);
~~~~~~~~~~~~~~^~
reduced-diags-macros.cpp:4:37: note: expanded from macro 'NO_INITIATION'
#define NO_INITIATION(x) int a = FF(x) * 2
                                    ^

Acually print:
reduced-diags-macros.cpp:7:15: warning: variable 'a' is uninitialized when used
within its own initialization [-Wuninitialized]
NO_INITIATION(a);
~~~~~~~~~~~~~~^~
reduced-diags-macros.cpp:4:37: note: expanded from macro 'NO_INITIATION'
#define NO_INITIATION(x) int a = FF(x) * 2
                                    ^
reduced-diags-macros.cpp:3:15: note: expanded from macro 'FF'
#define FF(x) x + 1
              ^

The last macro expansion should not be printed.

-- 
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/20150811/9a583d08/attachment.html>


More information about the llvm-bugs mailing list