Skip to content

Commit b719789

Browse files
authored
GCC 14 error suppressions (#3)
1 parent a9af7bc commit b719789

File tree

6 files changed

+108
-28
lines changed

6 files changed

+108
-28
lines changed

1.8.7-p374

+20-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,26 @@ install_bundler() {
2929
"$PREFIX_PATH"/bin/gem install bundler -v 1.17.3
3030
}
3131

32-
# Clang errors on warnings. Tell it to ignore this one.
33-
if cc -v 2>&1 | grep clang >/dev/null; then
34-
export RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
35-
fi
32+
RUBY_CFLAGS=""
33+
case "$(cc -v 2>&1)" in
34+
*gcc*)
35+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
36+
RUBY_CFLAGS+=" -Wno-implicit-int"
37+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
38+
RUBY_CFLAGS+=" -Wno-int-conversion"
39+
RUBY_CFLAGS+=" -Wno-return-type"
40+
;;
41+
*clang*)
42+
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
43+
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
44+
RUBY_CFLAGS+=" -Wno-implicit-int"
45+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
46+
RUBY_CFLAGS+=" -Wno-int-conversion"
47+
RUBY_CFLAGS+=" -Wno-return-type"
48+
;;
49+
esac
50+
export RUBY_CFLAGS
51+
3652

3753
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
3854
if type -p brew >/dev/null; then

1.9.3-p551

+17-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,23 @@ install_bundler() {
1010
"$PREFIX_PATH"/bin/gem install bundler -v 1.17.3
1111
}
1212

13-
# Clang errors on warnings. Tell it to ignore this one.
14-
if cc -v 2>&1 | grep clang >/dev/null; then
15-
export RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=int-conversion -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
16-
fi
13+
RUBY_CFLAGS=""
14+
case "$(cc -v 2>&1)" in
15+
*gcc*)
16+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
17+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
18+
RUBY_CFLAGS+=" -Wno-int-conversion"
19+
RUBY_CFLAGS+=" -Wno-return-type"
20+
;;
21+
*clang*)
22+
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
23+
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
24+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
25+
RUBY_CFLAGS+=" -Wno-int-conversion"
26+
RUBY_CFLAGS+=" -Wno-return-type"
27+
;;
28+
esac
29+
export RUBY_CFLAGS
1730

1831
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
1932
if type -p brew >/dev/null; then

2.3.3

+20-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,26 @@ install_bundler() {
1010
"$PREFIX_PATH"/bin/gem install bundler:1.17.3
1111
}
1212

13-
# Suppress warnings we aren't going to address so they don't flood build output"
14-
if cc -v 2>&1 | grep clang >/dev/null; then
15-
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
16-
fi
13+
RUBY_CFLAGS=""
14+
case "$(cc -v 2>&1)" in
15+
*gcc*)
16+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
17+
RUBY_CFLAGS+=" -Wno-implicit-int"
18+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
19+
RUBY_CFLAGS+=" -Wno-int-conversion"
20+
RUBY_CFLAGS+=" -Wno-return-type"
21+
;;
22+
*clang*)
23+
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
24+
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
25+
RUBY_CFLAGS+=" -Wno-implicit-int"
26+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
27+
RUBY_CFLAGS+=" -Wno-int-conversion"
28+
RUBY_CFLAGS+=" -Wno-return-type"
29+
;;
30+
esac
31+
export RUBY_CFLAGS
32+
1733

1834
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
1935
if type -p brew >/dev/null; then

2.3.8

+19-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,25 @@ install_bundler() {
1010
"$PREFIX_PATH"/bin/gem install bundler:1.17.3
1111
}
1212

13-
# Suppress warnings we aren't going to address so they don't flood build output"
14-
if cc -v 2>&1 | grep clang >/dev/null; then
15-
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
16-
fi
13+
RUBY_CFLAGS=""
14+
case "$(cc -v 2>&1)" in
15+
*gcc*)
16+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
17+
RUBY_CFLAGS+=" -Wno-implicit-int"
18+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
19+
RUBY_CFLAGS+=" -Wno-int-conversion"
20+
RUBY_CFLAGS+=" -Wno-return-type"
21+
;;
22+
*clang*)
23+
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
24+
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
25+
RUBY_CFLAGS+=" -Wno-implicit-int"
26+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
27+
RUBY_CFLAGS+=" -Wno-int-conversion"
28+
RUBY_CFLAGS+=" -Wno-return-type"
29+
;;
30+
esac
31+
export RUBY_CFLAGS
1732

1833
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
1934
if type -p brew >/dev/null; then

2.5.9

+17-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@ install_bundler() {
22
"$PREFIX_PATH"/bin/gem install bundler:2.3.27
33
}
44

5-
export RUBY_CFLAGS="-O3 -march=native"
5+
RUBY_CFLAGS="-O3 -march=native"
6+
case "$(cc -v 2>&1)" in
7+
*gcc*)
8+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
9+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
10+
RUBY_CFLAGS+=" -Wno-int-conversion"
11+
RUBY_CFLAGS+=" -Wno-return-type"
12+
;;
13+
*clang*)
14+
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
15+
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
16+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
17+
RUBY_CFLAGS+=" -Wno-int-conversion"
18+
RUBY_CFLAGS+=" -Wno-return-type"
19+
;;
20+
esac
21+
export RUBY_CFLAGS
622

723
package_option ruby configure --with-out-ext=tcl --with-out-ext=tk --disable-install-doc
824

9-
# GCC will complain about unrecognized warnings
10-
if cc -v 2>&1 | grep clang >/dev/null; then
11-
export RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=compound-token-split-by-macro -Wno-error=implicit-function-declaration"
12-
fi
13-
1425
install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl
1526
install_package "ruby-2.5.9" "https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.9.tar.bz2#bebbe3fe7899acd3ca2f213de38158709555e88a13f85ba5dc95239654bcfeeb" enable_shared standard
1627
install_bundler

2.7.8

+15-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ install_bundler() {
22
"$PREFIX_PATH"/bin/gem install bundler:2.4.22
33
}
44

5-
export RUBY_CFLAGS="-O3 -march=native"
6-
7-
# GCC will complain about unrecognized warnings
8-
if cc -v 2>&1 | grep clang >/dev/null; then
9-
export RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion"
10-
fi
5+
RUBY_CFLAGS="-O3 -march=native"
6+
case "$(cc -v 2>&1)" in
7+
*gcc*)
8+
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
9+
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
10+
RUBY_CFLAGS+=" -Wno-int-conversion"
11+
RUBY_CFLAGS+=" -Wno-return-type"
12+
;;
13+
*clang*)
14+
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
15+
RUBY_CFLAGS+=" -Wno-int-conversion"
16+
RUBY_CFLAGS+=" -Wno-return-type"
17+
;;
18+
esac
19+
export RUBY_CFLAGS
1120

1221
package_option ruby configure --with-out-ext=tcl --with-out-ext=tk --disable-install-doc
1322

0 commit comments

Comments
 (0)