GCC Newspaper
NOVEMBER 30, 2026
gcc — Proposed

Wshadow=retroactive-parameter

Proposes a new GCC warning flag to catch potentially dangerous retroactive parameter declarations.

Alejandro Colomar proposes a new GCC warning flag, -Wshadow=retroactive-parameter, to detect a specific type of dangerous coding pattern. This pattern involves declaring a function parameter that shadows a previously used variable within the same parameter list, which could lead to programmer confusion and bugs if the intuitive meaning differs from the compiler’s interpretation. The proposed warning aims to be included in -Wextra and should not break existing code, as it targets likely erroneous constructs.

In Details

This proposal introduces a new GCC warning option to detect a specific type of shadowing issue within function parameter declarations. The concern arises when a parameter name shadows a variable that has already been referenced within the *same* parameter list, before the parameter itself is declared. This could be a footgun for developers expecting intuitive behavior, particularly with C's declaration syntax.

Filed Under: gccwarningshadowingparameters