5 ms·
> What got this whole thing weird is that C doesn't like zero sized objects, but implementations were allowed to return a unique pointer for a zero sized alloca
by moremetadata 3y ago
> What got this whole thing weird is that C doesn't like zero sized objects, but implementations were allowed to return a unique pointer for a zero sized allocation.
Some of the windows API's work like this, so how much is pressure from MS?
Same discussion from 7 months ago.
https://news.ycombinator.com/item?id=32352965 https://news.ycombinator.com/item?id=32352965
https://thephd.dev/c23-is-coming-here-is-what-is-on-the-menu#n2897---memset_explicit https://thephd.dev/c23-is-coming-here-is-what-is-on-the-menu...
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2897.htm https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2897.htm
Pattern matching ram for variables/objects whilst they exist even if zero'ed or prefilled with a value doesnt give perfect security. Random values would make it harder to work out the variable/object.