News for hackers. Stuff that matters.
Re:Ask HN: Good practices for my first C project by nicoburns on Wednesday October 18, 2023 @04:36PM (#37934444)
Yeah, I really don't understand why people use signed integers so often. They seem... quirky. Especially in C where signed overflow is UB. I guess they're syntactically the default.

Would you consider the fixed width integer types (uint8_t, etc) a recent C feature worth using? The older type's size being implementation defined seems like a major pain to me, but I haven't used C much.

Re:Ask HN: Good practices for my first C project by G4E on Wednesday October 18, 2023 @04:59PM (#37934679)
stdint.h defining the fixed width integer is part of C99. I wouldn't call that recent !

https://pubs.opengroup.org/onlinepubs/009695399/basedefs/std...

Re:Ask HN: Good practices for my first C project by __d on Wednesday October 18, 2023 @06:49PM (#37935858)
You need to understand the timescales of C.

C89 (aka ANSI C) was "standard" C for years. C99 was released, and largely ignored until the mid-2000's, and then gradually began to grow. As of about 2015, C99 was probably the "standard" C dialect, but there is still a lot of C89 out there, especially where you have niche toolchains.

I wouldn't seriously consider C11 unless you're certain that the toolchain supports it, and there's some feature that you really need. And that's pretty unlikely.

Re:Ask HN: Good practices for my first C project by gavinhoward on Wednesday October 18, 2023 @05:03PM (#37934723)
Yes, fixed-width integer sizes are absolutely worth using.