gordonb.b3oxs
7/12/2008 11:53:00 PM
>----------------------------- 8< ----------------------------------
>7.1.3 Reserved identifiers
>[...]
>? All identifiers with external linkage in any of the following
>subclauses (including the future library directions) are always reserved
>for use as identifiers with external linkage.
>
>? Each identifier with file scope listed in any of the following
>subclauses (including the future library directions) is reserved for use
>as a macro name and as an identifier with file scope in the same name
>space if any of its associated headers is included.
>----------------------------- >8 ----------------------------------
>
>Does this mean I'm allowed to give a STATIC function a name starting
>with the str prefix ?
Not if you include <string.h>, in which case the second paragraph
above is an issue. Otherwise, it's OK.
>For instance, is the following code valid
>
>------------- 8< ---------------
>#include <stdio.h>
>
>static size_t strlen(const char *s)
>{
>/* My own strlen() code */
>}
>
>int main(void)
>{
> printf("%lu\n",(unsigned long)strlen("blahblah"));
>
> return 0;
>}
>------------- >8 ---------------
>
>?
It's OK, but I think it would be less confusing if you named it
something else.