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: C/C++ PATCH to implement -Wmultiline-expansion (PR c/80116)


Hi Marek,

Nice warning!  Just to confirm, would the patch warn with code like:

 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,
and the only similar instance I found in gcc is guarded
behind an #ifdef (in eh_data_format_name).

Thanks,
Pedro Alves


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