tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Compilers growing lint-like capabilities, but don't like lint-comments.




On 25.12.2016 20:09, coypu%SDF.ORG@localhost wrote:
> Hi,
> 
> Over time compilers are starting to performs some checks
> normally done by lint, such as warning about fallthrough
> cases being implicit.
> 
> cpp ignores comments, so they are opting to re-invent
> the lint terminology with things like __builtin_noreturn
> or [[gnu::fallthrough]].
> 
> this means that despite having the required comments, we
> need to turn off errors/warnings, which seems undesirable
> in the long run. It may spot something lint doesn't.
> 
> Would a giant rototill cocinelle patch to convert all
> those comments to a macro of our choosing be accepted?
> 

[[fallthrough]] attribute is proposal for C++17, supported in GCC7 and
Clang3.9.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r1.pdf

There are also other things like [[nodiscard]], [[maybe_unused]]..

Can we use it in GCC C?

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index