Obvious Things C Should Do

Paulo Pinto pjmlp at progtools.org
Wed Jan 29 12:42:52 UTC 2025


On Wednesday, 29 January 2025 at 09:57:27 UTC, Dukc wrote:
> On Monday, 13 January 2025 at 17:53:36 UTC, Walter Bright wrote:
>> On 1/13/2025 8:13 AM, Dukc wrote:
>>> [...]
>>
>> It's a bit more than that. It doesn't allow shift counts 
>> larger than the size of the field being shifted. It's too 
>> expensive to add such a check to runtime code.
>>
>>
>>> [...]
>>
>> It wouldn't be hard for the engine to mark uninitialized 
>> variables.
>
> You're thinking about implementing the engine. But I'm talking 
> about rewrite of the standard. Wouldn't the committee suddently 
> have to remove and define the majority of undefined behaviours 
> from the spec, at least when executed at compile time? Just 
> think how many undefined behaviours C has. I think it'd mandate 
> lots and lots of extra paperwork and design debates.
>
> I'm not saying it couldn't be done, but it's hardly the obvious 
> low-hanging fruit your article claims.

Actually they are in process of removing a few UB traps,

https://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm

See "Slay Some Earthly Demons" proposals.


More information about the Digitalmars-d mailing list