diff --git a/common/init.c b/common/init.c index 2cbff6fe..c22a1342 100644 --- a/common/init.c +++ b/common/init.c @@ -1,4 +1,8 @@ // 19 april 2019 +// TODO get rid of the need for this (it temporarily silences noise so I can find actual build issues) +#ifdef _MSC_VER +#define _CRT_SECURE_NO_WARNINGS +#endif #include #include #include diff --git a/test/testing.c b/test/testing.c index b616df54..5c5df531 100644 --- a/test/testing.c +++ b/test/testing.c @@ -13,6 +13,13 @@ struct defer { struct defer *next; }; +#ifdef _MSC_VER +// Microsoft defines jmp_buf with a __declspec(align()), and for whatever reason, they have a warning that triggers when you use that for any reason, and that warning is enabled with /W4 +// Silence the warning; it's harmless. +#pragma warning(push) +#pragma warning(disable: 4324) +#endif + struct testingT { const char *name; void (*f)(testingT *); @@ -26,6 +33,10 @@ struct testingT { int defersRun; }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + static void initTest(testingT *t, const char *name, void (*f)(testingT *), const char *file, long line) { t->name = name; diff --git a/test/testing.h b/test/testing.h index a600ec10..df7bb77c 100644 --- a/test/testing.h +++ b/test/testing.h @@ -18,7 +18,7 @@ #define testingprivMkCtor(basename, regfunc) \ __attribute__((constructor)) static void testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); } #elif defined(_MSC_VER) -#define testingprivMkCtor(basename, reg) \ +#define testingprivMkCtor(basename, regfunc) \ static int testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); return 0; } \ __pragma(section(".CRT$XCU",read)) \ __declspec(allocate(".CRT$XCU")) static int (*testingprivCtorPtrName(basename))(void) = testingprivCtorName(basename);