[PATCH:libX11 1/2] Bug 32098: Making XInternAtoms take const char ** breaks callers

Alan Coopersmith alan.coopersmith at oracle.com
Tue Dec 14 13:01:46 PST 2010


Simon Thum wrote:
> On 12/14/2010 02:22 AM, Alan Coopersmith wrote:
>> Callers who had successfully built without issues with the existing
>> libX11 headers were suddenly either given warnings or errors (-Werror)
>> with the new headers.
> I've stumbled into this and I'd really appreciate if someone could clarify.
> 
> AFAIK "const char**" promises "through that pointer no-one messes with
> the contents". So why the heck are there no implicit conversions to
> catch up with that? Do I need to pass -fapply-common-sense?

Because that's the way they wrote the C Standard specifications.

http://stackoverflow.com/questions/78125/why-cant-i-convert-char-to-a-const-char-const-in-c
has some suggestions for why this is, but I don't have a pointer to the
actual rationale from the ISO/ANSI standards commmittee.

Unfortunately, this was a surprise to me, since I was expecting it to
behave as const char * does when passed char * pointers, as apparently
did everyone on xorg-devel when the patch went by.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list