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).
52 lines
756 B
C
52 lines
756 B
C
// RUN: %clang_cc1 -emit-llvm %s -o %t
|
|
|
|
int A[10] = { 1,2,3,4,5 };
|
|
|
|
|
|
extern int x[];
|
|
void foo(void) { x[0] = 1; }
|
|
int x[10];
|
|
void bar(void) { x[0] = 1; }
|
|
|
|
|
|
extern int y[];
|
|
void *g = y;
|
|
|
|
int latin_ptr2len (char *p);
|
|
int (*mb_ptr2len) (char *p) = latin_ptr2len;
|
|
|
|
|
|
char string[8] = "string"; // extend init
|
|
char string2[4] = "string"; // truncate init
|
|
|
|
char *test(int c) {
|
|
static char buf[10];
|
|
static char *bufptr = buf;
|
|
|
|
return c ? buf : bufptr;
|
|
}
|
|
|
|
|
|
_Bool booltest = 0;
|
|
void booltest2(void) {
|
|
static _Bool booltest3 = 4;
|
|
}
|
|
|
|
// Scalars in braces.
|
|
static int a = { 1 };
|
|
|
|
// References to enums.
|
|
enum {
|
|
EnumA, EnumB
|
|
};
|
|
|
|
int c[] = { EnumA, EnumB };
|
|
|
|
// Binary operators
|
|
int d[] = { EnumA | EnumB };
|
|
|
|
// PR1968
|
|
static int array[];
|
|
static int array[4];
|
|
|