logoalt Hacker News

mrlonglong • last Monday at 9:18 PM • 4 replies • view on HN

Why redefine the stdints?


Replies

flohofwoe • today at 8:24 AM

It's ok as long as the types don't leak into the public API when the code is distributed as a library. But yeah, it looks like a leftover bad habit from pre-C99 times (I suspect the author is on Windows where MSVC was very late to the C99 party), and Microsoft also recommened for a while to build C code via the C++ compiler, which is where the "cast result of malloc" habit might come from.

indy • today at 8:53 AM

To make them easier to type and more aesthetically pleasing

jtari3333 • today at 8:28 AM

Typedefing uint32t to u32 etc is extremely common

veltas • today at 7:35 AM

They wanted shorter aliases for them to make their code clearer, I suppose.

➕ show 1 reply