Skip to content

Commit fc57f40

Browse files
committed
Error on signed-compare / possible loss of data.
1 parent ac3e0ca commit fc57f40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,16 @@ def build_extension(self, ext):
129129
if isinstance(self.compiler, MSVCCompiler) or getattr(self.compiler, 'compiler_type', '') == 'msvc':
130130
# set flags only available when using MSVC
131131
ext.extra_link_args.append('/MANIFEST')
132+
# conversion from '__int64' to 'Py_ssize_t', possible loss of data
133+
ext.extra_compile_args.append('/WX:4244')
132134
if COMPILE_DEBUG:
133135
ext.extra_compile_args.append('/Zi')
134136
ext.extra_compile_args.append('/MTd')
135137
ext.extra_link_args.append('/DEBUG')
136138
else:
137139
ext.extra_compile_args.append('/MT')
140+
else:
141+
ext.extra_compile_args.append('-Werror=sign-compare')
138142

139143
_build_ext.build_extension(self, ext)
140144

0 commit comments

Comments
 (0)