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: Make more bad uses of fallthrough attribute into pedwarns


On Wed, Nov 20, 2019 at 11:15:56PM +0000, Joseph Myers wrote:
> Various bad uses of the [[fallthrough]] attribute are constraint
> violations in C2x, so need pedwarns rather than warnings.
> 
> This patch duly turns the relevant warnings into pedwarns.  The
> relevant code is not specific to C, and does not know which form the
> attribute was given in ([[fallthrough]] or [[gnu::fallthrough]] or
> __attribute__((fallthrough))), but as I understand it these usages are
> also erroneous for C++ and it seems reasonable to give a pedwarn here
> even when a form other than [[fallthrough]] is being used.
> 
> The precise meaning of the standard wording about "The next statement
> that would be executed" seems a but unclear in some corner cases; the
> tests added keep to cases where it is clear whether or not the next
> statement executed is of the required form.
> 
> Bootstrapped with no regressions for x86_64-pc-linux-gnu.  OK to commit 
> (the gimplify.c changes)?

Can't approve but as the author of the code in question, I think this is OK.

--
Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA


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