On Wed, Jun 07, 2017 at 08:02:42PM +0100, Pedro Alves wrote:
> Hi Marek,
> 
> Nice warning!  Just to confirm, would the patch warn with code like:
 
Thanks.  BTW, if you (or anyone) could come up with a better name,
I'm all ears.

>  const char *
>  target_xfer_status_to_string (enum target_xfer_status status)
>  {
> #define CASE(X) case X: return #X
>    switch (status)
>      {
>        CASE(TARGET_XFER_E_IO);
>        CASE(TARGET_XFER_UNAVAILABLE);
>      default:
>        return "<unknown>";
>      }
> #undef CASE
>  };
> 
> ?
> 
> I think it shouldn't, but I couldn't tell from the tests,

Nope, it doesn't warn (neither C nor C++).  I should probably add this test.

        Marek

Reply via email to