The generated C is down to 3 warning shapes / 144 instances on the iOS
simulator leg, from 3,035 instances in 8 kinds when the census started. What is
left is three emitter defects, each of which is one fix that erases a whole
category:
| instances |
flag |
where it comes from |
| 98 |
-Wunused-variable |
a C auto is emitted per bytecode local slot |
| 42 |
-Wparentheses-equality |
if ((a == b)) shape in an emitted condition |
| 4 |
-Wimplicitly-unsigned-literal |
a literal too large for a signed int |
The unused-variable hypothesis, stated as a hypothesis.
BytecodeMethod.appendMethodC() walks localVariables and emits one C auto per
slot unconditionally, without consulting whether optimize() left a use. Every
method with a slot the optimizer killed then contributes one warning. Confirm
cheaply before writing any code: count how many of the 98 messages in the census
JSON name a locals_N_ identifier. If most do, the fix is at that emission
point.
-Wimplicitly-unsigned-literal (4) is worth reading as a possible bug rather
than a style nit -- it appears in java_lang_Long.m and
com_codename1_sensors_GestureEngine.m, and a literal silently reinterpreted as
unsigned changes comparison results.
Do not suppress these. Blanket-silencing translator output is how a codegen
defect hides forever; the whole point of putting generated C in scope was to fix
the emitters. If a residual genuinely cannot be fixed, the narrow fallback is a
#pragma GCC diagnostic prologue emitted from ByteCodeClass.generateCCode()
-- one emission point, visible in the generated file, and it behaves the same
under Xcode clang, clang-cl and gcc. Use the GCC spelling: gcc does not
understand #pragma clang diagnostic, and -Wunknown-pragmas is inside
-Wall. Every such pragma keeps a matching baseline row, because the pragma
silences the compiler and the row is what a human has to justify.
Acceptance: the generated group reaches 0 instances in the census summary,
and its baseline rows are deleted (stale rows are a hard failure by design).
Found by the native warning census (scripts/check-native-warnings.py).
The generated C is down to 3 warning shapes / 144 instances on the iOS
simulator leg, from 3,035 instances in 8 kinds when the census started. What is
left is three emitter defects, each of which is one fix that erases a whole
category:
-Wunused-variable-Wparentheses-equalityif ((a == b))shape in an emitted condition-Wimplicitly-unsigned-literalThe unused-variable hypothesis, stated as a hypothesis.
BytecodeMethod.appendMethodC()walkslocalVariablesand emits one C auto perslot unconditionally, without consulting whether
optimize()left a use. Everymethod with a slot the optimizer killed then contributes one warning. Confirm
cheaply before writing any code: count how many of the 98 messages in the census
JSON name a
locals_N_identifier. If most do, the fix is at that emissionpoint.
-Wimplicitly-unsigned-literal(4) is worth reading as a possible bug ratherthan a style nit -- it appears in
java_lang_Long.mandcom_codename1_sensors_GestureEngine.m, and a literal silently reinterpreted asunsigned changes comparison results.
Do not suppress these. Blanket-silencing translator output is how a codegen
defect hides forever; the whole point of putting generated C in scope was to fix
the emitters. If a residual genuinely cannot be fixed, the narrow fallback is a
#pragma GCC diagnosticprologue emitted fromByteCodeClass.generateCCode()-- one emission point, visible in the generated file, and it behaves the same
under Xcode clang, clang-cl and gcc. Use the
GCCspelling: gcc does notunderstand
#pragma clang diagnostic, and-Wunknown-pragmasis inside-Wall. Every such pragma keeps a matching baseline row, because the pragmasilences the compiler and the row is what a human has to justify.
Acceptance: the
generatedgroup reaches 0 instances in the census summary,and its baseline rows are deleted (stale rows are a hard failure by design).
Found by the native warning census (
scripts/check-native-warnings.py).