This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: Implement -Wswitch-fallthrough


On Mon, Jul 11, 2016 at 3:43 PM, Marek Polacek <polacek@redhat.com> wrote:
> But then the [[fallthrough]] attribute was
> approved for C++17 [1], and that's what has got me to do all this.
>  ...
> I added a new builtin,
> __builtin_fallthrough, that prevents the warning from occurring.  It can only
> be used in a switch; the compiler will issue an error otherwise.  The new C++
> attribute can then be implemented in terms of this builtin.

This is a stupid question I'm sure, but if C++ can have the attribute
version, why can't C have __attribute__((fallthrough)) ?


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