c2 [C] Preprocessors - #if, #ifdef, #if defined In this posting, we will take a look at the differences among #if, #ifdef, and #if defined. #if #if directive only works with a true or false value. #define TEST1 #if TEST #error "This would be an error as well." #endif It can be used with an expression. #define TEST0 #if (TEST == 0) #error "This would be an error as well." #endif It is also able to extend with #elif and #else. #define TEST2 #if.. 2021. 6. 11. [C] Get return address of functions (__builtin_return_address) Let's get the return address of a function with __builtin_return_address. Syntax void* __builtin_return_address(unsigned int level); level 0 : Return the address of the current function 1 : Return the address of the caller of the current function 2 ~ 63 : Return the address of the caller's caller, and so forth If the top of the call stack has been reached, the function will return 0. It is usual.. 2021. 3. 2. 이전 1 다음