News for hackers. Stuff that matters.
Re:C's Flexible Integer Sizes Were Not a Design Mistake by nickcw on Sunday September 27, 2026 @06:47AM (#49865489)
The fixed size int types int32_t and friends weren't introduced until C99. Microsoft held out until 2013 before it put <inttypes.h> into Visual Studio!

So there has been a really long time in C's evolution where we haven't had fixed size types which has been a super annoying mess of #ifdefs in portable code.

The variable size ints have allowed some super weird architectures though. I remember looking at the datasheet for the Motorola 56000 DSP and noting that the C compiler set char = short = int = 24 bits! That was because the hardware could not address anything smaller than 24 bits. I think long could be 48 bits.

Re:C's Flexible Integer Sizes Were Not a Design Mistake by ThrowawayB7 on Sunday September 27, 2026 @04:14PM (#49870391)
The product is named Visual C++, that it happened to do C was always kind of a sideshow as far as I could tell. Aside from that, I seem to recall that VC++ had the WORD, DWORD, and eventually QWORD macros to specify unsigned 16, 32 and 64 bit types respectively.
Re:C's Flexible Integer Sizes Were Not a Design Mistake by 3836293648 on Sunday September 27, 2026 @06:02PM (#49871303)
And their names are so frustrating. We don't run 16 bit systems any more. Word is a word that means something and I don't care what a word was on the 8086. The only honest things the WORD macro could expand to are size_t and ssize_t. 64bit is not a quad word, it's just a word.
Re:C's Flexible Integer Sizes Were Not a Design Mistake by yndoendo on Tuesday September 29, 2026 @02:44PM (#49898377)
I find Microsoft method of naming every type with a pointer a major annoyance. This is one reason I find reading non-Windows C applications easier.

Give me `int*` vs `PINT`. Microsoft really likes to over engineer causing you have to pointlessly remember more.

The worst is when they redefine the same structure or union under a different name. Example: `IP_ADAPTER_ANYCAST_ADDRESS_XP` is the exact same as `IP_ADAPTER_MULTICAST_ADDRESS_XP`.

Re:C's Flexible Integer Sizes Were Not a Design Mistake by dcrazy on Sunday September 27, 2026 @06:14PM (#49871379)
Prior to Visual C++ (the first version of which shipped for Windows 3.x), Microsoft sold a “Microsoft C/C++” as well as Microsoft QuickC:

- https://winworldpc.com/product/microsoft-c-c/5x

- https://winworldpc.com/product/quick-c/10-for-windows

Re:C's Flexible Integer Sizes Were Not a Design Mistake by pjmlp on Monday September 28, 2026 @03:24AM (#49874668)
And in 2012 they officially considered C++ the way to go.

https://herbsutter.com/2012/05/03/reader-qa-what-about-vc-an...

There was a change of heart a few years later, but the wind seems to have stopped after all the security discussions,

https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-...

Re:C's Flexible Integer Sizes Were Not a Design Mistake by pjmlp on Monday September 28, 2026 @03:26AM (#49874677)
Re:C's Flexible Integer Sizes Were Not a Design Mistake by convolvatron on Sunday September 27, 2026 @04:29PM (#49870501)
I always just defined these types in a per-platform portability header myself.
Re:C's Flexible Integer Sizes Were Not a Design Mistake by someonebaggy on Sunday September 27, 2026 @09:46PM (#49872611)
Microsoft had [unsigned] __int{8,16,32,64}