New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Adds C++ warning flag for C Variable-Length Arrays. #15342

Merged
merged 1 commit into from Jun 1, 2017

Conversation

Projects
None yet
3 participants
@chardan
Contributor

chardan commented May 28, 2017

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 unintentionally write
a VLA-- adding this warning will help us catch that.

Signed-off-by: Jesse Williamson jwilliamson@suse.de

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.

Signed-off-by: Jesse Williamson <jwilliamson@suse.de>

@liewegas liewegas changed the title from Adds C++ warning flag for C Variable-Length Arrays. to build: Adds C++ warning flag for C Variable-Length Arrays. Jun 1, 2017

@liewegas liewegas merged commit f6220d1 into ceph:master Jun 1, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Jun 2, 2017

@chardan next time, i'd recommend fix these warnings before enabling this -Wvla flag . now my compiling out is shinning like a christmas tree.

wjwithagen added a commit to wjwithagen/ceph that referenced this pull request Jun 4, 2017

build: revert -Wvla from ceph#15342
 - VLAs are in GCC and Clang, and are there to stay forever,
   if only to be compatible with all the software that is already
   out there.
   - Theoretical debates about VLA being hard to implement are
     long superceded by th actual implentations
 - Before setting this flag is would be required to first start
   work on fixing all the fallout/warnings that will arise from
   setting -Wvla
 - Allocating large variable/stuctures on the stack could be asking
   for trouble, but changes that ceph tools are going to be running
   on small embedded devices are rather slim.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>

liewegas added a commit that referenced this pull request Jun 5, 2017

Merge pull request #15469 from wjwithagen/wip-wjw-revert-wvla
build: revert -Wvla from #15342

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment