[Dwarf-discuss] Proposal: C standard release dates for DW_AT_language_version, clarify semantics
Adrian Prantl
aprantl@apple.com
Wed Apr 24 21:57:17 GMT 2024
> On Apr 24, 2024, at 2:49 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Wed, Apr 24, 2024 at 02:25:37PM -0700, Adrian Prantl via Dwarf-discuss wrote:
>> # C standard release dates for DW_AT_language_version, clarify semantics
>>
>> ## Background
>>
>> The list of languages at https://dwarfstd.org/languages-v6.html does not list release dates for the ISO C standard. Producers need to know what version numbers they should produce though. I scanned the ISO website for appropriate dates to use.
>>
>> ## Proposed Changes
>>
>> Augment the table of language encodings to add
>> C (K&R and ISO) DW_LNAME_C 0x0003 0 YYYYMM
>>
>> K&R 000000
>> C89 198912
>> C99 199912
>> C11 201112
>> C17 201806 (sic!)
>> C2x >201806
>
> That is not correct.
> C99 199901
> C11 201112
> C17 201710
> C23 202311
Thanks for correcting these! Do you happen to have a link to the source you used to look these up?
>
> C89 with ammendment 1 would be
> 199409
> C89 likely that 198912 indeed.
>
> As for C++, the above page is missing
> C++23 202302
>>
>> Add the following non-normative wording:
>>
>> To convert a version number to a specific release, it is good practice to treat the YYYMM version numbers listed in this document as the maximum version that is interpreted as belonging to a specific release.
>
>> This way consumers can emit version numbers for unreleased upcoming specifications, by using, e.g., the date the compiler was built.
>
> That is not a good suggestion.
> If a compiler supports some part of e.g. C23 but not everything, it should
> be something larger than 201710 but smaller than 202311, even when the date
> the compiler was built could be 202404 or later.
> GCC and Clang up to 17 used e.g. 202000 for C23 partial implementations,
> GCC still does, Clang 18+ now uses 202311.
That is what I had in mind, but I didn't think about a compiler built after a standard was released. Do you have a suggestion for a better wording to capture that nuance?
thanks,
Adrian
>
> Jakub
More information about the Dwarf-discuss
mailing list