C Language

C Macro Override Bug: When #define Breaks Build System Configuration

In embedded firmware development, configuration is often controlled through compiler macros passed from the build system. This keeps the codebase flexible and allows easy customization for different products or hardware variants. In this blog post, we will explore how a macro can introduce a subtle bug, often referred to as a C macro override bug […]

C Macro Override Bug: When #define Breaks Build System Configuration Read More »

How to Detect Bit Changes in C/C++ Using the XOR Operator and Bit Masking

When working with C or C++, particularly in embedded systems and firmware development, the ability to detect bit changes in C/C++ is essential. Because instead of writing: bool flag1; bool flag2; bool flag3; bool flag4; bool flag5; bool flag6; In embedded systems, we often store multiple related status flags inside a single variable. Generally, we

How to Detect Bit Changes in C/C++ Using the XOR Operator and Bit Masking Read More »