Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lsof
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
lsof
3y ago
On that note, something that caught me off guard once is that C11 _Alignof and GCC __alignof__ can differ: for example in 32-bit x86 __alignof__(double) == 8 but _Alignof(double) == 4; however __alignof__(struct { double d; }) == 4. Apparen
2.
▲
by
lsof
4y ago
> I’m quite confused by “bitfield” do you mean the container field (the one that’s actually defined by the `bitfield` keyword) or the contained sub-fields? By 'field' I meant the contained sub-fields
3.
▲
by
lsof
4y ago
Red is the least significant bit, because offsets start at bit #0. Endianness is not a concern because you have to specify the underlying integer type, and bit endianness is not a thing, so it's just the native endianness (if you, e.g.
4.
▲
by
lsof
4y ago
The language I'm working on has the following syntax bitfield ColorWriteMaskFlags : u32 { red 1 bool, green 1 bool, blue 1 bool, alpha 1 bool, }; The number after the field name is the bit size. An (offset, siz
5.
▲
by
lsof
4y ago
Well, I meant that loops are limited within the normal constraints of the C standard, which doesn't offer tail call elimination, but indeed as you point out it is easy to work around it in practice using clang or gcc optimization passe
6.
▲
by
lsof
4y ago
That printf exploit is quite impressive I think.
7.
▲
C99 doesn't need function bodies, or 'VLAs are Turing complete'
(lemon.rip)
296 points
by
lsof
4y ago
|
249 comments