[LLVMbugs] [Bug 16138] New: -std=c99 still defines 'index()' legacy posix function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 24 09:54:47 PDT 2013


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

            Bug ID: 16138
           Summary: -std=c99 still defines 'index()' legacy posix function
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: albertnetymk at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When I use clang to compile this file:
```
#include <stdio.h>

int index; // this is the line causing problem.
int main(int argc, char **argv)
{
    puts("hello");
    return 0;
}
```
I got the error: redefinition of 'index' as different kind of symbol.

It turns out that `index` is one deprecated one function in posix.

Using `gcc -std=c99` fixes the problem, but `clang -std=c99` doesn't do the
trick.

Is this because `index()` is still defined in c99?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130524/4137eafb/attachment.html>


More information about the llvm-bugs mailing list