njn | 16eeb4e | 2005-06-16 03:56:58 +0000 | [diff] [blame] | 1 | #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 | |
| 8 | int main(int argc, char* argv[]) |
| 9 | { |
bart | f976f6c | 2011-04-03 17:42:19 +0000 | [diff] [blame] | 10 | char *s, *a __attribute__((unused)), *b __attribute__((unused)); |
njn | 256c214 | 2005-06-17 19:28:29 +0000 | [diff] [blame] | 11 | 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); |
njn | 16eeb4e | 2005-06-16 03:56:58 +0000 | [diff] [blame] | 18 | } |