From 25043544897e62d9431d5d39e21823cface3743f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 16 Mar 2021 20:11:05 +0000 Subject: 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. --- .travis.yml | 8 ++++++-- Tools/testflags.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f1fd1fe8..92acc7c27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Tools/testflags.py b/Tools/testflags.py index f3d216b59..16e4d8aee 100755 --- a/Tools/testflags.py +++ b/Tools/testflags.py @@ -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, -- cgit v1.2.1