|
|
Subscribe / Log in / New account

Ignoring undefined behaviour

Ignoring undefined behaviour

Posted Oct 31, 2024 8:20 UTC (Thu) by milesrout (subscriber, #126894)
In reply to: Ignoring undefined behaviour by khim
Parent article: realloc() and the oversize importance of zero-size objects

>And since actual version of ISO C standard is not mentioned anywhere (presumably to ensure that possible bugfixes are automatically picked)… that means that by ratifying that change they have, effectively, added undefined behavior to most existing versions of POSIX specification.

This is not true. POSIX.1-2024 says in Chapter 1 of Volume 2 (https://pubs.opengroup.org/onlinepubs/9699919799/function...):

>This volume of POSIX.1-2024 is aligned with the following standards, except where stated otherwise:
>ISO C (C17)
> ISO/IEC 9899:2018, Programming Languages — C.
>Parts of the ISO/IEC 9899:2018 standard (hereinafter referred to as the ISO C standard) are referenced to describe requirements also mandated by this volume of POSIX.1-2024.

And earlier versions have similar language:

>Great care has been taken to ensure that this volume of POSIX.1-2017 is fully aligned with the following standards:
>ISO C (1999)
> ISO/IEC 9899:1999, Programming Languages - C, including ISO/IEC 9899:1999/Cor.1:2001(E), ISO/IEC 9899:1999/Cor.2:2004(E), and ISO/>IEC 9899:1999/Cor.3.
>Parts of the ISO/IEC 9899:1999 standard (hereinafter referred to as the ISO C standard) are referenced to describe requirements also mandated by this volume of POSIX.1-2017.

Note the 'hereinafter referred to as the ISO C standard' bit.


to post comments

Ignoring undefined behaviour

Posted Oct 31, 2024 8:24 UTC (Thu) by milesrout (subscriber, #126894) [Link]

Note that this means that, despite being released in 2024, the 8th edition of POSIX still refers to "C17" (the 2018 edition of ISO C) and not to C23, despite 2024 being after 2023. That is, at least in part, because, as far as I know, the official standard for C23 still hasn't been released! It is expected to be finalised this year but who knows? It could well end up being ISO/IEC 9899:2025, which would be pretty funny.


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