[cairo] return type of cairo_status_to_string ()

Bill Spitzak spitzak at gmail.com
Tue Aug 17 21:23:13 PDT 2010


Daniel Goldman wrote:

> And what about the analogous function 
> "char *strerror (int errnum)"?

Old functions have not been modified precisely because people are 
assigning the results to a char* rather than a const char*.

Since Cairo is "new" and there is no legacy code trying to call this 
function, this excuse is not needed.

> But the man page says "This string must not be modified by the 
> application".

That is *precisely* the purpose of making the return value "const 
char*", it tells the compiler that the program should not attempt to 
modify the returned string.


More information about the cairo mailing list