blob: e3fd9436b4d4b1ac75fad85fd0ed5053237c6b2b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
diff --unified --recursive --text --color pak.orig/etterna-0.70.4/src/RageUtil/Utils/RageUtil.h pak.new/etterna-0.70.4/src/RageUtil/Utils/RageUtil.h
--- pak.orig/etterna-0.70.4/src/RageUtil/Utils/RageUtil.h 2021-04-05 23:39:53.000000000 +0200
+++ pak.new/etterna-0.70.4/src/RageUtil/Utils/RageUtil.h 2021-05-14 21:19:05.609179000 +0200
@@ -543,6 +543,16 @@
auto
GetLocalTime() -> struct tm;
+// Supress warnings about format strings not being string literals
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-security"
+#elif defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+#elif defined(_MSC_VER)
+// TODO: Suppress warnings for Windows
+#endif
template<typename... Args>
auto
ssprintf(const char* format, Args... args) -> std::string
@@ -551,10 +561,16 @@
size_t size = snprintf(nullptr, 0, format, args...) + 1;
std::unique_ptr<char[]> buf(new char[size]);
snprintf(buf.get(), size, format, args...);
-
// Don't want the '\0' inside
return std::string(buf.get(), buf.get() + size - 1);
}
+#if defined(__clang__)
+#pragma clang pop
+#elif defined(__GNUC__)
+#pragma GCC pop
+#elif defined(_MSC_VER)
+// TODO: Suppress warnings for Windows
+#endif
template<typename... Args>
auto
|