Skip to content

Commit 82b7812

Browse files
committed
Turning off clang warnings.
Ignoring string literal warnings in tests output.
1 parent 14ef3dc commit 82b7812

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cmake/Warnings.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ function(target_set_warnings)
4040
# C and C++ Warnings
4141
-Wunused # warn on anything being unused
4242
-Wformat=2 # warn on security issues around functions that format output
43-
-Wcast-align # warn for potential performance problem casts
44-
-Wconversion # warn on type conversions that may lose data
45-
-Wsign-conversion # warn on sign conversions
43+
# -Wcast-align # warn for potential performance problem casts
44+
# -Wconversion # warn on type conversions that may lose data
45+
# -Wsign-conversion # warn on sign conversions
4646
-Wnull-dereference # warn if a null dereference is detected
4747
-Wdouble-promotion # warn if float is implicit promoted to double
4848
)

test/cutest.h

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* IN THE SOFTWARE.
2424
*/
2525

26+
#pragma clang diagnostic push
27+
#pragma clang diagnostic ignored "-Wformat-nonliteral"
2628
#ifndef CUTEST_H__
2729
#define CUTEST_H__
2830

@@ -157,6 +159,7 @@ static size_t test_print_in_color__(int color, const char *fmt, ...)
157159
size_t n;
158160

159161
va_start(args, fmt);
162+
160163
vsnprintf(buffer, sizeof(buffer), fmt, args);
161164
va_end(args);
162165
buffer[sizeof(buffer) - 1] = '\0';
@@ -711,3 +714,5 @@ int main(int argc, char **argv)
711714
#endif
712715

713716
#endif /* #ifndef CUTEST_H__ */
717+
718+
#pragma clang diagnostic pop

0 commit comments

Comments
 (0)