Add ruby 3.0 testing

testflags tweak for C standard > c90

Only add -Wdeclaration-after-statement for > c90 as c99 allows
declarations after a statement.
This commit is contained in:
William S Fulton 2021-03-16 20:11:05 +00:00
commit 2504354489
2 changed files with 12 additions and 4 deletions

View file

@ -62,7 +62,7 @@ matrix:
dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=go VER=1.12
env: SWIGLANG=go VER=1.12 CSTD=gnu99
dist: xenial
- compiler: gcc
os: linux
@ -276,6 +276,10 @@ matrix:
os: linux
env: SWIGLANG=ruby VER=2.7
dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=ruby VER=3.0 CSTD=c99
dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=scilab
@ -369,7 +373,7 @@ matrix:
- compiler: clang
os: osx
osx_image: xcode12.2
env: SWIGLANG=go
env: SWIGLANG=go CSTD=gnu99
- compiler: clang
os: osx
osx_image: xcode12.2

View file

@ -3,11 +3,15 @@
def get_cflags(language, std, compiler):
if std == None or len(std) == 0:
std = "gnu89"
c_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type -Wdeclaration-after-statement -Wmissing-field-initializers"
c_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type -Wmissing-field-initializers"
if std == "gnu89" or std == "gnu90":
# gnu89 standard allows declaration after headers
# use c99 or gnu99 if feature is necessary for using target language
c_common = c_common + " -Wdeclaration-after-statement"
cflags = {
"csharp":"-Werror " + c_common,
"d":"-Werror " + c_common,
"go":"-Werror " + c_common + " -Wno-declaration-after-statement",
"go":"-Werror " + c_common,
"guile":"-Werror " + c_common,
"java":"-Werror " + c_common,
"javascript":"-Werror " + c_common,