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

Jonny Grant via cfe-dev cfe-dev at lists.llvm.org
Sat Jan 5 23:35:32 PST 2019



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? Could the other Annex 
K be added in a libc.

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)

Jonny


More information about the cfe-dev mailing list