I usually write a macro like this:
#define UNUSED(x) (void)(x)
You can use this macro for all your unused parameters. (Note that this works on any compiler.)
For example:
void f(int x) {
UNUSED(x);
...
}
More Related Contents:
- warning: incompatible implicit declaration of built-in function ‘xyz’
- How to print the address of a function?
- Why does GCC not warn for unreachable code?
- Is there a way to get warned about unused functions?
- Competitive programming: "Time exceeded error"
- Program is working on code block but not in hacker rank
- why the program is not terminating in gcc? [closed]
- Using GCC to produce readable assembly?
- What does this GCC error “… relocation truncated to fit…” mean?
- Is an empty initializer list valid C code?
- Working of fork() in linux gcc [duplicate]
- How does GCC implement variable-length arrays?
- Why is the maximum size of an array “too large”?
- Build .so file from .c file using gcc command line
- How Can I debug a C program on Linux?
- Implementation of nested functions
- In GNU C inline asm, what are the size-override modifiers for xmm/ymm/zmm for a single operand?
- Why do I get different results when I dereference a pointer after freeing it?
- How can a shared library (.so) call a function that is implemented in its loader code?
- Cannot calculate factorials bigger than 20! ! How to do so?
- How can I include a needed C library using GCC?
- Is there a GCC keyword to allow structure-reordering?
- Why does gcc use movl instead of push to pass function args?
- Is free() zeroing out memory?
- c math linker problems on Ubuntu 11.10 [duplicate]
- Where/how to get the “getline” function if it is missing from stdio.h?
- GCC memory barrier __sync_synchronize vs asm volatile(“”: : :”memory”)
- getrandom syscall in C not found
- argv: Sanitizing wildcards
- Query on -ffunction-section & -fdata-sections options of gcc