On Thu, 5 Nov 2009, zmoelnig@iem.at wrote:
this is the code: static lqt_file_type_t guess_qtformat(const char* filename) { char * extension = strrchr(filename, '.'); } which means: that we expect strrchr() to take "const char*" and "int", and to return "char*" "man strrchr" says: char *strrchr(const char *s, int c); i don't see any problems here. what is it, that i am missing?
Ok, I made a mistake, I thought I remembered strrchr returned const char *. This is what your compiler is assuming, because what it reports about is a cast from const to non-const, which is what your error message is about.
What happens is that you are using the (new) C++ headers, which doesn't have the above declaration as in the manpage, and instead is using the following declarations (for covariant constness: so that the return type is exactly like the 1st argument):
const char * strchr ( const char * str, int character ); char * strchr ( char * str, int character );
(from #include <strchr>)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801