[LLVMbugs] [Bug 11651] New: Warn about "restrict" violations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 24 16:01:28 PST 2011


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

             Bug #: 11651
           Summary: Warn about "restrict" violations
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: joerg at NetBSD.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Consider:

#include <stdio.h>

char buf[1024];

void foo(int c)
{
    snprintf(buf, sizeof(buf), "%s %d", buf, c);
}

This is derived from code found e.g. in NetBSD. It should give a warning, since
the first argument of snprintf is marked as restrict, but another reference is
provided.

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