This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Lint-style comments, more generally

Seeing how long the thread on gcc-patches on what comments
-Wimplicit-fallthrough should recognize has gotten, I thought it might
be a good idea to start a discussion on lint-style comments more
generally. Instead of just limiting the use of lint-style comments to
-Wimplicit-fallthrough, why not split the recognition of it off into a
separate switch (-flint-style-comments or -Wlint-style-comments) that
can be taken advantage of by other warnings? Here are some examples
I've seen in actual code:
/*NOTREACHED*/ to tell the compiler that code is unreachable; could be
useful if the -Wunreachable-code warning were to be revived. I
suggested making this equivalent to __builtin_unreachable() on a bug
on bugzilla, but apparently that also affects codegen, so instead of
making the two exactly equivalent, how about if the comment just
silences the warning and leaves the codegen the same?
/*ARGSUSED*/ which is pretty similar to __attribute__((unused)) or
#pragma unused; could also be used to silence -Wunused-parameter
/*VARARGS*/ for functions with a variable number of arguments; I'm not
aware of any GCC warnings that this one would currently silence.

Further links I found by Googling:
(lists some other ones I hadn't seen) (scroll down to
the "Traditional Lint Comments" section) (The
FreeBSD cpp seems to have a '-lint' flag; apparently their GCC
supports a #pragma lint),.Invocation.html
(seems to be the same as the previous, but with some further
commentary about option naming)

Anyways, what do people think?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]