diff mbox

[rdma-core,7/8] Enable -Wformat=2

Message ID 1476483257-16308-8-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe Oct. 14, 2016, 10:14 p.m. UTC
This is useful to detect functions that are handling format strings but
not marked with __attribute__(format), as well as other sorts
for format related mistakes.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd58a7039618..8f21ba384c12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,7 @@  RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
 
 # At some point around 5.4 gcc fixed missing-field-initializers to ignore this
 # common idiom we use extensively. Since this is a useful warning for