logoalt Hacker News

unwindlast Sunday at 7:43 PM1 replyview on HN

For C, the proper/expected/standard way to reference a variable without accessing it is a cast to void:

    (void) a;
I'm sure there are commonly-implemented compiler extensions, but this is the normal/native way and should always work.

Replies

amlutolast Sunday at 10:12 PM

Not if you use GCC.

https://godbolt.org/z/zYdc9ej88

clang gets this right.

show 3 replies