Home | History | Annotate | Download | only in tests
      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 {
     10    char *s, *a __attribute__((unused)), *b __attribute__((unused));
     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);
     18 }
     19