slab: (Default)
In my last post I mentioned:
a lot of this was pre-<stdint.h> so the integer typedefs were u8/u16/u32 and i8/i16/i32. u64 and i64 were classes in some cases, which is probably a cursed-c++ post all of its own

... so here's that post. )
slab: (Default)
Every now and then I will read a paper or see a talk about error handling in C++, and often they will take one of two forms:
  • Use exceptions! Always use exceptions.
  • Never use exceptions! Return error codes instead. (If it's something sufficiently new, it might bring up std::expected.


I've yet to see anyone show up with an implementation of the C++ error propagation mechanism that was pervasive at my old workplace, so I will impart upon you the (possibly-cursed) knowledge of...

status chaining

okay, what )
slab: (Default)
(I originally posted this over on cohost, but cohost will be shutting down so I'm reposting it here.)

While writing this comment I had a story from circa 2015 that didn't really fit in the comment so I figured I should instead branch it out into A Post because I don't really do enough of those here.

So, MSVC has a /kernel flag that it gained at some point (I want to say MSVC 12.0 or so, but Microsoft doesn't have the documentation online for anything earlier than MSVC 2015 anymore). This flag tells the compiler that you're building something to run in the Windows kernel. For C++, this also turns off exceptions and RTTI, so you're getting a subset of C++, but even a subset of C++ can be pretty useful.

There is also another thing that that flag does which is a bit more subtle.
Read more... )

Profile

slab: (Default)
slab

July 2025

S M T W T F S
   12345
6789101112
13141516171819
20212223242526
2728293031  

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 12th, 2025 01:21 pm
Powered by Dreamwidth Studios