Who
Aaron Ballman is a Principal Compiler Engineer for Intel and is the lead maintainer of the Clang open source compiler. He has two decades of experience writing cross-platform frameworks in C/C++, compiler & language design, and software engineering best practices and is currently a voting member of the C (WG14) and C++ (WG21) standards committees.
In case you can't figure it out easily enough, the views expressed here are my personal views and not the views of my employer, my past employers, my future employers, or some random person on the street. Please yell only at me if you disagree with what you read.
Search
Author Archives: Aaron Ballman
Musings on the C charter
Within the C committee, there’s been a lot of talk about what the C charter means and whether it should be updated or not. My personal musing on the topic is that the C charter needs to be updated in … Continue reading
What’s New in C in 2023?
The year is 2023 and you’re asking “What’s new in C?” Surely the answer is “absolutely nothing”, right? Wrong! C23 will be released in the coming months (likely in early 2024), and this is a whirlwind tour of what changes … Continue reading
Don’t use the [[likely]] or [[unlikely]] attributes
C++20 introduced the likelihood attributes [[likely]] and [[unlikely]] as a way for a programmer to give an optimization hint to their implementation that a given code path is more or less likely to be taken. On its face, this seems … Continue reading
Member Function Ref Qualifiers
One of the lesser-known features of C++11 is the fact that you can overload your non-static member functions based on whether the implicit this object parameter is an lvalue reference or an rvalue reference by specifying a functions ref-qualifier. This … Continue reading
Binary Operator Overloading
In C++, there are two forms of binary operator overloading you can use when designing an API. The first form is to overload the operator as a member function of the class, and the second form is to overload the … Continue reading
Implementing a four-bit adder with C++ template metaprogramming
I recently read a post by Phillip Larkson where the C preprocessor was used to implement a four-bit adder entirely at compile time. This got me wondering whether I could implement the same concept using C++ template metaprogramming. It seemed … Continue reading
Interesting Note About the sizeof Operator
The expression used in a sizeof operator is an unevaluated expression in C and C++. This can make for some surprising situations if you are unaware of it. For instance: This code will print 12 instead of 13 because the … Continue reading
MSVC Pointer Type Attributes
One of the lesser-known features of Visual Studio’s C/C++ compiler are the pointer type attributes __ptr32 and __ptr64. More information about them can be found on MSDN. These pointer type attributes are used to control the visible size and behavior … Continue reading
Posted in C/C++, Win32
2 Comments
Small Break in the Silence
Just because I’ve not written many posts lately doesn’t mean I’ve been silent. You should go check out the Tidbits page, it currently has over 20 little juicy pieces of information about C and C++. I’ve been using it as … Continue reading
Posted in Uncategorized
Leave a comment
How Variable Argument Lists Work in C
Variable argument lists are very arcane in the world of C. You’ll see them expressed in function signatures as … at the end of the parameter list, but you may not understand how they work or what they do.