Ralf Wildenhues wrote: > you should not used `index' at > all: eventually, you'll be including strings.h and getting warnings due > to this (seen on GNU/Linux): > > | NAME > | index, rindex - locate character in string > | > | SYNOPSIS > | #include <strings.h> > | > | char *index(const char *s, int c); > [...] > | CONFORMING TO > | 4.3BSD
No, there is no reason nowadays (for several years already) to #include <strings.h>. - All systems have a <string.h> that define memset, memcpy etc. - more portable than bzero, bcopy, etc. - Likewise for index() and rindex(), which have a more portable alternative called strchr() and strrchr(). - The strcasecmp() and strncasecmp() functions declared there don't work in multibyte locales. - The ffs() function has a more portable (and sometimes faster) implementation that converts to a 'double' and extracts the exponent from its binary representation. And so we are free to use 'index' as a variable name. Bruno