[cfe-dev] global variable named index

Jean-Daniel Dupas devlists at shadowlab.org
Tue Oct 13 22:40:58 PDT 2009


Le 14 oct. 2009 à 07:26, Jean-Daniel Dupas a écrit :

>
> Le 12 oct. 2009 à 12:58, Richard Pennington a écrit :
>
>> 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).
>>
>
>
> It is part of the UNIX'03 Spec
>
> http://www.unix.org/version3/apis/t_2.html
>

My bad, I wrongly interpret the function table. You're right about it  
no longer part of POSIX.





More information about the cfe-dev mailing list