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

            Bug ID: 15421
           Summary: indexing an integral type with a pointer type
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

C allows "indexing an integral type with a pointer type":

int a;
char *p;
a[p];

This is an obscure feature, and is possibly the result of C trying to mimic
some assembly syntax.

The proposal is to give a warning and 2 notes:
- warning: indexing an integral type with a pointer is an obscure feature
- note: use ``p[a]'' to silence this warning
- note: use ``*(p + a)'' to allow p and a to be flippable macro parameters,
while silencing this warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to