|
|
Log in / Subscribe / Register

Malcolm: Usability improvements in GCC 8

Malcolm: Usability improvements in GCC 8

Posted Mar 20, 2018 14:50 UTC (Tue) by nix (subscriber, #2304)
In reply to: Malcolm: Usability improvements in GCC 8 by ledow
Parent article: Malcolm: Usability improvements in GCC 8

It's not just GCC that generates errors like that, of course. A month or so ago I spent some time fixing this utterly mystifying DTrace error message:

translator member pr_fname definition uses incompatible types : "char [16]" = "char [16]"

Er, yeah, right, that explains everything! The actual error was that one "char" was actually "char on a system where char == unsigned char" and the other was a signed "char" since the system was mistakenly assuming that char is always signed -- so the types were not identical, but of course the internal signedness of char is not being printed out in random error messages...

(Of course this was an error in an *implementation*. If a legitimate user got this error, it would be a sign that someone, probably me, had screwed up.)


to post comments

Malcolm: Usability improvements in GCC 8

Posted Mar 20, 2018 17:19 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (1 responses)

In C, "char", "signed char", and "unsigned char" are all three distinct types. "char" may or may not be signed, but it is not 100% replaceable with the explicit variants.

See this[1] SO answer.

[1]https://stackoverflow.com/questions/75191/what-is-an-unsi...

Malcolm: Usability improvements in GCC 8

Posted Mar 21, 2018 14:31 UTC (Wed) by nix (subscriber, #2304) [Link]

Yes indeed: I kind of assumed that knowledge from the readers. This was a bug in implementation code that was erroneously assuming the identity of char and signed char, and fell over when ported to a platform in which the C char type was unsigned.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds