[LLVMbugs] [Bug 7045] New: Analyzer should honor __attribute__((const))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 4 14:41:35 PDT 2010


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

           Summary: Analyzer should honor __attribute__((const))
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: boris.dusek at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4821)
 --> (http://llvm.org/bugs/attachment.cgi?id=4821)
Minimal test case

Hi,

clang static analyzer should honor __attribute__((const)) - see the attached
test case.
tested with ANALYZER BUILD: checker-240 (2010-04-11 10:44:34)

Attaching a minimal test case. The real case (from which the test case is
derived) had "strcmp" as the "const" function. Since in string.h, strcmp is not
tagged as "const", this raises another and separate problem and that is tagging
all "const" functions accordingly (using the macro __pure2, like I have seen),
so that the proposed functionality becomes usable.

Attribute "pure" might also be worth looking at, but I am not sure it's OK to
do the same thing with it as I proposed with "const".

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