Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit 52575f2

Browse files
committed
fix(test_stress): move _CRT_SECURE_NO_WARNINGS before includes
The _CRT_SECURE_NO_WARNINGS define must appear before ANY #include statements to suppress MSVC warnings. Moving it to the top of the file before all includes fixes getenv warnings on Windows.
1 parent fdf4e52 commit 52575f2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/c/test_stress.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
** Copyright 2026 PhotoStructure Inc.
1616
** MIT License
1717
*/
18+
19+
/* Must be first - suppress MSVC warnings before any includes */
20+
#ifdef _WIN32
21+
#define _CRT_SECURE_NO_WARNINGS
22+
#endif
23+
1824
#define _POSIX_C_SOURCE 199309L
1925
#include "unity/unity.h"
2026
#include <sqlite3.h>
@@ -26,7 +32,6 @@
2632

2733
/* Platform-specific headers for file operations */
2834
#ifdef _WIN32
29-
#define _CRT_SECURE_NO_WARNINGS /* Suppress MSVC warnings for getenv */
3035
#include <io.h>
3136
#include <process.h> /* For _getpid */
3237
#include <sys/types.h>

0 commit comments

Comments
 (0)