Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bool NullFunc(const struct timespec *when, const char *who)
- {
- return TRUE;
- }
- #define UNUSED(x) (void)(x)
- void f(int x) {
- UNUSED(x);
- ...
- }
- auto lambda = [](workerid_t workerId) -> void { };
- auto lambda = [](__attribute__((unused)) _workerid_t workerId) -> void { } ;
- #ifdef __GNUC__
- # define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
- #else
- # define UNUSED(x) UNUSED_ ## x
- #endif
- #ifdef __GNUC__
- # define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x
- #else
- # define UNUSED_FUNCTION(x) UNUSED_ ## x
- #endif
- void foo(int UNUSED(bar)) { ... }
- static void UNUSED_FUNCTION(foo)(int bar) { ... }
- int foo (__attribute__((unused)) int bar) {
- return 0;
- }
- void foo(int __attribute__((unused))key)
- {
- }
- void foo(int key)
- {
- int hash = 0;
- int bkt __attribute__((unused)) = 0;
- api_call(x, hash, bkt);
- }
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wunused-parameter"
- <code with unused parameters here>
- #pragma GCC diagnostic pop
- If (MSVC)
- Set (CMAKE_EXE_LINKER_FLAGS "$ {CMAKE_EXE_LINKER_FLAGS} / NODEFAULTLIB: LIBCMT")
- Add_definitions (/W4 /wd4512 /wd4702 /wd4100 /wd4510 /wd4355 /wd4127)
- Add_definitions (/D_CRT_SECURE_NO_WARNINGS)
- Elseif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
- Add_definitions (-Wall -W -pedantic)
- Else ()
- Message ("Unknown compiler")
- Endif ()
- if (when || who || format || data || len);
- void foo(int x) {
- x; /* unused */
- ...
- }
Add Comment
Please, Sign In to add comment