cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
// RUN: %clang_analyze_cc1 -analyzer-checker debug.ExprInspection -Wno-deprecated-non-prototype -verify %s
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker debug.ExprInspection -Wno-deprecated-non-prototype -verify %s \
|
|
// RUN: -analyzer-config support-symbolic-integer-casts=true
|
|
|
|
void clang_analyzer_denote(int, const char *);
|
|
void clang_analyzer_express(int);
|
|
void clang_analyzer_dump(int);
|
|
void clang_analyzer_dump_ptr(int *);
|
|
|
|
void SymbolCast_of_float_type_aux(int *p) {
|
|
clang_analyzer_dump_ptr(p); // expected-warning {{&x}}
|
|
clang_analyzer_dump(*p); // expected-warning {{Unknown}}
|
|
// Storing to the memory region of 'float x' as 'int' will
|
|
// materialize a fresh conjured symbol to regain accuracy.
|
|
*p += 0;
|
|
clang_analyzer_dump_ptr(p); // expected-warning {{&x}}
|
|
clang_analyzer_dump(*p); // expected-warning {{conj_$0{int}}
|
|
clang_analyzer_denote(*p, "$x");
|
|
|
|
*p += 1;
|
|
// This should NOT be (float)$x + 1. Symbol $x was never casted to float.
|
|
clang_analyzer_express(*p); // expected-warning{{$x + 1}}
|
|
}
|
|
|
|
void SymbolCast_of_float_type(void) {
|
|
extern float x;
|
|
void (*f)() = SymbolCast_of_float_type_aux;
|
|
f(&x);
|
|
}
|