[cfe-dev] C++ Annex K safe C11 functions

Jonny Grant via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 16 10:09:05 PST 2019



On 07/01/2019 17:48, JF Bastien wrote:
> 
> 
>> On Jan 5, 2019, at 11:35 PM, Jonny Grant <jg at jguk.org> wrote:
>>
>>
>>
>> On 04/01/2019 21:50, JF Bastien wrote:
>>>> On Jan 4, 2019, at 1:47 PM, Jonny Grant <jg at jguk.org <mailto:jg at jguk.org>> wrote:
>>>>
>>>> Hi! Sounds great
>>>> How about setting uninitialised variables to 0xdeadbeef or 0xabbaabba so its easily identifiable when they crop up in use?
>>>> We used to clear buffers to 0x11111111 and stack to 0x22222222 I recall
>>> This isn’t relevant to the Annex K discussion, let’s keep this thread focused. We discussed initialization values in the original thread as well as the code review, it’s worth reading through that to see why I chose the values I did (mainly so pointers are invalid, and they’re repeated byte-values so the code generation is better).
>>
>> OK.
>>
>> BTW, I don't think Clang has its own libc does it?
> 
> Correct, clang doesn’t have its own libc. It does have some interception headers for some things, and plenty of builtins.
> 
> 
>> Could the other Annex K be added in a libc.
> 
> What do you mean?
> 
> 
>> Or at a push, in Clang's libc++ (I know it is meant to be C11 standard, not C++, but C++ usually includes C functions anyway)
> 
> I’d rather not. I want to implement builtins, and let libc implementations use them as they wish.
> 

Sounds good. I've not created a clang ticket on 
https://bugs.llvm.org/enter_bug.cgi  to track adding the safe C11 
functions. Let me know if you'd like me to file it.

Cheers, Jonny



More information about the cfe-dev mailing list