You can use it as a sort of assertion that an expression has arithmetic type:
#define CHECK_ARITHMETIC(x) (+(x))
This will generate a compile-time error if x
evaluates to (say) a pointer.
That is about the only practical use I can think of.
Related Contents:
- What does i = (i, ++i, 1) + 1; do?
- Parameter evaluation order before a function calling in C
- How to printf a memory address in C
- Using if (!!(expr)) instead of if (expr)
- Why an expression instead of a constant, in a C for-loop’s conditional?
- Difference between i++ and (i)++ in C
- What is the difference between char s[] and char *s?
- How can I get a file’s size in C? [duplicate]
- What does opening a file actually do?
- Is it better to use C void arguments “void foo(void)” or not “void foo()”? [duplicate]
- Get a substring of a char* [duplicate]
- Still Reachable Leak detected by Valgrind
- Why have i++; i–; right after each other?
- Call Go functions from C
- Practical usage of setjmp and longjmp in C
- Should struct definitions go in .h or .c file?
- Reading string from input with space character? [duplicate]
- Getting terminal width in C?
- Why do I get a C malloc assertion failure?
- How can I compare strings in C using a `switch` statement?
- Threadsafe vs re-entrant
- Assigning strings to arrays of characters
- Is it possible to determine the thread holding a mutex?
- Addresses of two char pointers to different string literals are same
- What are C macros useful for?
- Using malloc for allocation of multi-dimensional arrays with different row lengths
- C99 inline function in .c file
- ‘printf’ with leading zeros in C
- C warning implicit declaration of function ‘exit’
- How to convert an Expression to a Predicate
- printf string, variable length item
- How to define and work with an array of bits in C?
- Curiosity: Why does Expression when compiled run faster than a minimal DynamicMethod?
- getch and arrow codes
- Implicit function declarations in C
- C char* to int conversion
- Does gcc define anything when -g is specified?
- What is the difference between ssize_t and ptrdiff_t?
- What does %s and %d mean in printf in the C language? [closed]
- Associative arrays in C
- Should one really set pointers to `NULL` after freeing them?
- How does fork() know when to return 0?
- how to exit a child process – _exit() vs. exit
- Difference between INT_MAX and __INT_MAX__ in C
- Should I set errno?
- Win32 – Backtrace from C code
- Is there a useful case using a switch statement without braces?
- Why do ‘?’ and ‘\?’ give the same output in C?
- Implicit declaration of function ‘close’
- How do you read C declarations?