[cfe-dev] global variable named index
Richard Pennington
rich at pennware.com
Mon Oct 12 03:58:29 PDT 2009
Chris Lattner wrote:
>
> On Oct 11, 2009, at 8:55 PM, Vasudev.Negi at microchip.com
> <mailto:Vasudev.Negi at microchip.com> wrote:
>
>> If I have a global variable named index, clang-cc throws an error
>> saying redefinition of index as different kind of symbol. Why can’t I
>> have a variable named index?
>>
>
> 'index' is the name of a function defined by the C standard library.
> Try 'man index' on the command line.
>
'index' was originally defined in BSD unix. It evolved into 'strchr'.
It is not part of the C standard library, nor is it a part of POSIX
(since POSIX.1-2008).
According to the Linux man page, it is defined in "strings.h".
-Rich
More information about the cfe-dev
mailing list