Getting silly with C: four tricks that break GCC's parser

Getting silly with C, part and((int*)-8)[3]

Getting silly with C: four tricks that break GCC's parser

In the fourth installment of his C humor series, lcamtuf demonstrates four code snippets that exploit glitches in GCC's parser, including a K&R-style function declaration with unnamed parameters and an empty union type. The post explains how these tricks work, such as using && as a label address operator and zero-sized types to make pointer arithmetic a no-op.

First, this is sort-of a K&R function declaration, *except* K&R function declarations are no longer accepted by GCC: "int x() int foo; { }" -> "error: old-style parameter declarations".

More from this day

2026-08-21