[LLVMbugs] [Bug 13369] New: segfault printing statement with _Pragma and compound literal

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 15 15:29:46 PDT 2012


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

             Bug #: 13369
           Summary: segfault printing statement with _Pragma and compound
                    literal
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: william at 25thandClement.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang-analyzer segfaults on this code when trying to print the offending
statement. In this case, the offense being an unused variable assigned in the
first line of main, not the use of inline pragmas guarding a compound literal
;)


define quietinit(...) \
        _Pragma("clang diagnostic push") \
        _Pragma("clang diagnostic ignored \"-Winitializer-overrides\"") \
        __VA_ARGS__ \
        _Pragma("clang diagnostic pop")

struct s { int m; };

#define s_new(...) (quietinit(&(struct s){ 0, __VA_ARGS__ }))

int main(int argc, char *argv[]) {
        struct s *x = s_new(.m = argc);

        return 0;
} /* main() */

-- 
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