Flags parameter in comptypes
Joseph S. Myers
jsm@polyomino.org.uk
Sun Jun 6 22:31:00 GMT 2004
c-typeck.c:comptypes has a flags parameter that isn't documented in the
comment above the function. This was added without documentation by
2003-07-11 Geoffrey Keating <geoffk@apple.com>
...
(comptypes): Add extra parameter to prototype.
...
I would ask that documentation of this parameter be added. However, the
use of this parameter seems to have been removed by
2003-08-30 Zack Weinberg <zack@codesourcery.com>
...
(comptypes): Use it instead of flags parameter to identify
structure types from different translation units.
...
The flags parameter is only used in recursive calls to comptypes,
function_types_compatible_p, tagged_types_tu_compatible_p and
type_lists_compatible_p, which just pass the parameter among themselves.
Thus the only point I can see in the parameter is that it makes the
interface compatible with the C++ front end - but this isn't being used
anywhere (no common code calls comptypes). Do we really want to keep an
unused parameter passed among four functions on the basis that it might be
useful for interface compatibility in future?
Would it make sense to file a feature-request PR asking that
-Wunused-parameter detect such situations? (We had such a situation -
albeit simpler with only one function rather than four involved - before
in digest_init <http://gcc.gnu.org/ml/gcc/2001-05/msg00899.html>.)
--
Joseph S. Myers
jsm@polyomino.org.uk
More information about the Gcc
mailing list