Skip to content

Commit 626c56b

Browse files
committed
#108 #110 Added mandatory compiler options -Werror=incompatible-pointer-types and -Werror=incompatible-function-pointer-types
Fixup for #110 #108
1 parent d5167e9 commit 626c56b

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

ext/extconf.rb

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,31 @@
3939
# $CFLAGS='-fPIC -fno-strict-aliasing -g3 -ggdb -O2 -fPIC'
4040
config_file = File.join(File.dirname(__FILE__), 'config_options.rb')
4141
load config_file if File.exist?(config_file)
42+
cflags = [$CFLAGS]
43+
cflags.push(*%w[
44+
-Werror=implicit-function-declaration
45+
-Werror=discarded-qualifiers
46+
-Werror=incompatible-pointer-types
47+
])
48+
49+
if RbConfig::MAKEFILE_CONFIG['CC'].include?('clang')
50+
cflags.push(*%w[
51+
-Werror=incompatible-function-pointer-types
52+
])
53+
end
4254

43-
$CFLAGS += ' -Werror=implicit-function-declaration -Werror=discarded-qualifiers'
4455

4556
if ENV['debase_debug']
46-
$CFLAGS += ' -Wall -Werror'
47-
$CFLAGS += ' -g3'
57+
cflags.push(*%w[
58+
-Wall
59+
-Werror
60+
-g3
61+
])
4862
end
4963

64+
$CFLAGS += ' ' + cflags.join(' ')
65+
66+
5067
dir_config("ruby")
5168
if !Debase::RubyCoreSource.create_makefile_with_core(hdrs, "debase_internals")
5269
STDERR.print("Makefile creation failed\n")

0 commit comments

Comments
 (0)