On Sat, Jun 3, 2017 at 2:50 AM, Willem Jan Withagen <wjw@xxxxxxxxxxx> wrote: > Hi, > > Now that we have -Wvla set: > === > Adds C++ warning flag for C Variable-Length Arrays. > > C VLAs are not supported in C++. However, the GNU compiler allows > them as an extension, which it does not warn about when not in > pedantic mode. Unfortunately, it's easy to accidentally write > a VLA, even unintentionally-- adding this warning will help us > catch that. > === > > Are there going to be attempts to eradicate this usage? > Note that Clang also supports VLAs: > === > GCC and C99 allow an array's size to be determined at run time. This > extension is not permitted in standard C++. However, Clang supports such > variable length arrays for compatibility with GNU C and C99 programs. > === > it's not in C++11 standard. but it's a handy feature in practice. i still have trouble understanding we want to have -Wvla. i was trying to silence this warning option last night but failed to move further after several attempts. see https://github.com/ceph/ceph/pull/15441. probably, Jesse have more insights on this. > --WjW > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Regards Kefu Chai -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html