abi
Why is a boolean 1 byte and not 1 bit of size?
Because the CPU can’t address anything smaller than a byte.
Difference between API and ABI
API: Application Program Interface This is the set of public types/variables/functions that you expose from your application/library. In C/C++ this is what you expose in the header files that you ship with the application. ABI: Application Binary Interface This is how the compiler builds an application. It defines things (but is not limited to): How … Read more
Does the C++ standard allow for an uninitialized bool to crash a program?
Yes, ISO C++ allows (but doesn’t require) implementations to make this choice. But also note that ISO C++ allows a compiler to emit code that crashes on purpose (e.g. with an illegal instruction) if the program encounters UB, e.g. as a way to help you find errors. (Or because it’s a DeathStation 9000. Being strictly … Read more
What is an application binary interface (ABI)?
One easy way to understand “ABI” is to compare it to “API”. You are already familiar with the concept of an API. If you want to use the features of, say, some library or your OS, you will program against an API. The API consists of data types/structures, constants, functions, etc that you can use … Read more