chore: enable clang suspicious implicit conversion warning and fix related type narrowing issues

Add CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES to both Debug and Release Xcode build configurations. Fix the resulting warnings by adding explicit casts in wren_compiler.c (readUnicodeEscape, emit, emitShort, emitByteArg) and wren_vm.c (READ_SHORT macro, makeCallStub bytecode assignment) to prevent unintended truncation or sign extension during implicit integer conversions.
This commit is contained in:
Bob Nystrom
2015-03-22 17:36:08 +00:00
parent 4343b95c04
commit 899a4ec76e
3 changed files with 11 additions and 9 deletions
@@ -269,6 +269,7 @@
29AB1F101816E3AD004B501E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_PEDANTIC = NO;
@@ -279,6 +280,7 @@
29AB1F111816E3AD004B501E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_PEDANTIC = NO;