I maintain an open source program that builds with autoconf.
Right now I'm having a problem with some of my users. They are using a pre-distributed VM from an organization that has an incorrect prototype for strchr in it. Their prototype is:
char *strchr(char *,int c);
when of course we know it should be:
char *strchr(const char *s,int c);
(which is itself broken, as the output should really be const char *
, but then you couldn't modify what it gives you if you passed in a char *
and not a const char *
, but I digress.
My question: is there a way to create an autoconf macro that determines which prototype is in use and use it accordingly? I'd rather not make my code say:
v = strchr((char *)s,c);
Thanks!