[LLVMbugs] [Bug 9669] New: add compile time check for out of bounds array definitions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 10 06:02:02 PDT 2011


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

           Summary: add compile time check for out of bounds array
                    definitions
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: impulze at impulze.org
                CC: llvmbugs at cs.uiuc.edu


Hi there, I was wondering if it's sensible to add a compile-time check for out
of bounds definitions for arrays like g++ already does for strings.


impulze at localhost ~ $ printf 'int main(){char f[1]="f";}' | g++ -x c++ -
<stdin>: In function ‘int main()’:
<stdin>:1:22: error: initializer-string for array of chars is too long

impulze at localhost ~ $ printf 'int main(){char f[1]="f";}' | clang++ -x c++ -

impulze at localhost ~ $ clang ++ --version
clang version 3.0 (/var/cache/paludis/distfiles/scm/clang
f65076ebf5e8bc5ae7b77fe3c3a65dc5db8d763f)
Target: x86_64-pc-linux-gnu
Thread model: posix

Not sure if this is maybe related tohttp://llvm.org/bugs/show_bug.cgi?id=5028

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