Skip to content
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

chardan
Copy link
Contributor

@chardan 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

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 Adds C++ warning flag for C Variable-Length Arrays. build: Adds C++ warning flag for C Variable-Length Arrays. Jun 1, 2017
@liewegas liewegas merged commit f6220d1 into ceph:master Jun 1, 2017
@tchaikov
Copy link
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
 - 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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants