Skip to content

Commit 91618c5

Browse files
committed
clang and gcc both support VLAs
1 parent ad42cdc commit 91618c5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,13 @@ def self.cxx_block_support_ok?
481481
end
482482
memoize :cxx_block_support_ok?, true
483483

484+
def self.cxx_supports_wno_vla_cxx_extension_flag?
485+
return try_compile_with_warning_flag(
486+
"Checking for C++ compiler '-Wno-vla-cxx-extension' support",
487+
:cxx, '', '-Wno-vla-cxx-extension')
488+
end
489+
memoize :cxx_supports_wno_vla_cxx_extension_flag?, true
490+
484491
# Returns whether compiling C++ with -fvisibility=hidden might result
485492
# in tons of useless warnings, like this:
486493
# http://code.google.com/p/phusion-passenger/issues/detail?id=526

src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def self.default_extra_c_or_cxxflags(cc_or_cxx)
144144
# Avoids some compilaton warnings with Boost on Ubuntu 14.04.
145145
flags << "-Wno-unused-local-typedefs"
146146
end
147+
148+
if cxx_supports_wno_vla_cxx_extension_flag?
149+
flags << "-Wno-vla-cxx-extension"
150+
end
147151
else
148152
flags << debugging_cflags
149153
end

0 commit comments

Comments
 (0)