[ub] Sized integer types and char bits

Gabriel Dos Reis gdr at axiomatics.org
Sun Oct 27 18:17:20 CET 2013


Jeffrey Yasskin <jyasskin at google.com> writes:

| On Sun, Oct 27, 2013 at 1:06 AM, Jean-Marc Bourguet <jm at bourguet.org> wrote:
| > On 26/10/2013 22:51, John Regehr wrote:
| >>> ... there is no
| >>> representation change when converting a signed int value to unsigned int
| >>> or when converting an unsigned int value to signed int.
| >> Wow-- anyone care to guess what fraction of existing C programs run
| >> correctly under these conditions?
| > Define correctly.  Note that they have a switch to get a more conform
| > behaviour, but they preferred to provide by default a non-conform
| > one,
| 
| And AFAICS they didn't bother to implement a C++ compiler at all,
| indicating to me that the niche for C is that of being easy to
| implement, not that of supporting more machines (since it _doesn't_
| support the efficient mode for this machine).

Or it could be (market) demand for C++ on that platform.

I suspect it is a lot more to it that just difficulty of implementing a
non-conforming C++ compiler.

| 
| If we make the C++ definition stricter, either unusual machines will
| keep implementing just C because it's still easier, or they'll
| implement a non-conforming mode for C++ as the default and a
| conforming mode as a switch, just like they do for C.
| 
| Jeffrey


More information about the ub mailing list