Re: [Boost-bugs] [Boost C++ Libraries] #8408: Boost is not compatible with Clang's -Wimplicit-fallthrough diagnostic

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8408: Boost is not compatible with Clang's -Wimplicit-fallthrough diagnostic
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-10 14:45:04


#8408: Boost is not compatible with Clang's -Wimplicit-fallthrough diagnostic
------------------------------------------------------+---------------------
  Reporter: Alexander Kornienko <alexfh@…> | Owner: johnmaddock
      Type: Patches | Status: new
 Milestone: To Be Determined | Component: config
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
------------------------------------------------------+---------------------

Comment (by gromer@…):

 FWIW I agree with alexfh that the macro should require a semicolon at the
 point of use. I'm kind of flabbergasted that "while(0)" warns in MSVC;
 "do{...}while(0)" is an idiomatic way of providing a macro that can be
 used wherever a statement is expected, and "while(true)" or the equivalent
 is an even more idiomatic way of writing a loop with no condition. This
 Stack Overflow answer seems to indicate a consensus that MSVC's warning is
 broken: http://stackoverflow.com/a/1946485

 As for the idea of disabling the warning with pragmas, I think that would
 be a missed opportunity: unintended fall-through is a common source of
 real bugs, and in places where fall-through is intended, I think
 explicitly annotating that fact makes the code more readable. If we're
 going to mark up the source files anyway, why not mark them up in a way
 that enhances readability and catches bugs?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8408#comment:13>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC