[cfe-dev] C++ Annex K safe C11 functions
JF Bastien via cfe-dev
cfe-dev at lists.llvm.org
Mon Jan 7 09:48:08 PST 2019
> 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).
> 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.
More information about the cfe-dev