blob: 2c77f0903e78dd42554fdbb739f7975c710dc07c [file] [log] [blame]
njn16eeb4e2005-06-16 03:56:58 +00001#include <stdlib.h>
2#include <string.h>
3
4// The issue here is the same one in memcmptest -- 'strchr' and 'index' are
5// aliases, as are 'strrchr' and 'rindex'. In each case, the shorter name
6// gets preferred, ie. 'index' and 'rindex'.
7
8int main(int argc, char* argv[])
9{
bartf976f6c2011-04-03 17:42:19 +000010 char *s, *a __attribute__((unused)), *b __attribute__((unused));
njn256c2142005-06-17 19:28:29 +000011 s = malloc(sizeof(char));
12
13 // Nb: s[0] is uninitialised, but almost certainly a zero
14
15 a = strchr (s, '1');
16 b = strrchr(s, '1');
17 return 0;//((int)a + (int)b);
njn16eeb4e2005-06-16 03:56:58 +000018}