[前][次][番号順一覧][スレッド一覧]

ruby-changes:52937

From: shyouhei <ko1@a...>
Date: Thu, 18 Oct 2018 17:33:57 +0900 (JST)
Subject: [ruby-changes:52937] shyouhei:r65151 (trunk): .travis.yml: add -pedantic build

shyouhei	2018-10-18 17:33:52 +0900 (Thu, 18 Oct 2018)

  New Revision: 65151

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65151

  Log:
    .travis.yml: add -pedantic build
    
    Now that we have allow_failures, why not add configurations
    that are prone to fail.  The first thing I want to add is
    $CC -ansi -pedantic, which spots lots of bugs on my local
    machine.

  Modified files:
    trunk/.travis.yml
Index: .travis.yml
===================================================================
--- .travis.yml	(revision 65150)
+++ .travis.yml	(revision 65151)
@@ -74,6 +74,44 @@ matrix: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L74
         - git -C $brew_core_dir checkout -q 25590710e3f7af9cfa173c5cd3eb41a0532107b6
         - HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade openssl@1...
         - /usr/local/opt/openssl@1.../bin/openssl version
+    - name: pedanticism
+      os: linux
+      compiler: "'clang -ansi -Werror=pedantic -pedantic-errors -std=iso9899:1990'"
+      env:
+        - "JOBS="
+      # construct warnflags (using bashism...)
+      before_install: |
+        warnflags_array=(
+          -Wall
+          -Wextra
+          -Werror=declaration-after-statement
+          -Werror=deprecated-declarations
+          -Werror=division-by-zero
+          -Werror=extra-tokens
+          -Werror=implicit-function-declaration
+          -Werror=implicit-int
+          -Werror=long-long
+          -Werror=pointer-arith
+          -Werror=shorten-64-to-32
+          -Werror=write-strings
+          -Wmissing-noreturn
+          -Wno-constant-logical-operand
+          -Wno-extended-offsetof
+          -Wno-missing-field-initializers
+          -Wno-overlength-strings
+          -Wno-parentheses-equality
+          -Wno-self-assign
+          -Wno-tautological-compare
+          -Wno-unused-local-typedef
+          -Wno-unused-parameter
+          -Wunused-variable
+        )
+        CONFIG_FLAG=(
+          --disable-install-doc
+          optflags=-O0
+          debugflags=-g0
+          warnflags="${warnflags_array[*]}"
+          LDFLAGS=-Wno-unused-command-line-argument)
     - os: linux
       language: ruby
       rvm: 2.3
@@ -88,6 +126,8 @@ matrix: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L126
   allow_failures:
     # It randomly hangs on travis osx. Let's remove this from allow_failures once it gets stable.
     - os: osx
+    - name: pedanticism
+  fast_finish: true
 
 before_script:
   - "echo JOBS=$JOBS"
@@ -105,7 +145,7 @@ before_script: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L145
   - "chmod -R a-w ."
   - "chmod u+w build config_1st config_2nd"
   - "cd build"
-  - "../configure -C --disable-install-doc --prefix=/tmp/ruby-prefix --with-gcc=$CC $CONFIG_FLAG"
+  - "../configure -C --disable-install-doc --prefix=/tmp/ruby-prefix --with-gcc=\"$CC\" \"${CONFIG_FLAG[@]}\""
   - "cp -pr config.cache config.status .ext/include ../config_1st"
   - "make reconfig"
   - "cp -pr config.cache config.status .ext/include ../config_2nd"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]