diff mbox series

Makfile: add more warning flags to ensure we catch more issues

Message ID 20200319004937.473594-1-colin.king@canonical.com
State Superseded
Headers show
Series Makfile: add more warning flags to ensure we catch more issues | expand

Commit Message

Colin Ian King March 19, 2020, 12:49 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Increase the build warning checks to catch bad code. This builds
with gcc 9.3, gcc 10.0, clang 9 and clang 10 without issues.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/Makefile.am | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Alex Hung March 19, 2020, 12:57 a.m. UTC | #1
On 2020-03-18 6:49 p.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Increase the build warning checks to catch bad code. This builds
> with gcc 9.3, gcc 10.0, clang 9 and clang 10 without issues.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/Makefile.am | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 904fc020..8aacff02 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -15,7 +15,13 @@ AM_CPPFLAGS = \
>  	`pkg-config --silence-errors --cflags json-c`	\
>  	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
>  	-Wall -Werror -Wextra				\
> -	-Wno-address-of-packed-member
> +	-Wno-address-of-packed-member			\
> +	-Wfloat-equal -Wmissing-declarations		\
> +	-Wmissing-format-attribute -Wno-long-long	\
> +	-Wredundant-decls -Wshadow 			\
> +	-Wno-missing-field-initializers 		\
> +	-Wno-missing-braces -Wno-sign-compare 		\
> +	-Wno-multichar -Wcast-qual
>  
>  bin_PROGRAMS = fwts
>  
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu March 20, 2020, 3:34 a.m. UTC | #2
On 3/19/20 8:49 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Increase the build warning checks to catch bad code. This builds
> with gcc 9.3, gcc 10.0, clang 9 and clang 10 without issues.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/Makefile.am | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 904fc020..8aacff02 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -15,7 +15,13 @@ AM_CPPFLAGS = \
>  	`pkg-config --silence-errors --cflags json-c`	\
>  	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
>  	-Wall -Werror -Wextra				\
> -	-Wno-address-of-packed-member
> +	-Wno-address-of-packed-member			\
> +	-Wfloat-equal -Wmissing-declarations		\
> +	-Wmissing-format-attribute -Wno-long-long	\
> +	-Wredundant-decls -Wshadow 			\
> +	-Wno-missing-field-initializers 		\
> +	-Wno-missing-braces -Wno-sign-compare 		\
> +	-Wno-multichar -Wcast-qual
>  
>  bin_PROGRAMS = fwts
>  
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin Ian King March 20, 2020, 11:49 a.m. UTC | #3
On 19/03/2020 00:49, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Increase the build warning checks to catch bad code. This builds
> with gcc 9.3, gcc 10.0, clang 9 and clang 10 without issues.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/Makefile.am | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 904fc020..8aacff02 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -15,7 +15,13 @@ AM_CPPFLAGS = \
>  	`pkg-config --silence-errors --cflags json-c`	\
>  	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
>  	-Wall -Werror -Wextra				\
> -	-Wno-address-of-packed-member
> +	-Wno-address-of-packed-member			\
> +	-Wfloat-equal -Wmissing-declarations		\
> +	-Wmissing-format-attribute -Wno-long-long	\
> +	-Wredundant-decls -Wshadow 			\
> +	-Wno-missing-field-initializers 		\
> +	-Wno-missing-braces -Wno-sign-compare 		\
> +	-Wno-multichar -Wcast-qual
>  
>  bin_PROGRAMS = fwts
>  
> 
This causes issues. I've sent a V2 without the -Missing-format-attribute
warning enabled
diff mbox series

Patch

diff --git a/src/Makefile.am b/src/Makefile.am
index 904fc020..8aacff02 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,7 +15,13 @@  AM_CPPFLAGS = \
 	`pkg-config --silence-errors --cflags json-c`	\
 	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
 	-Wall -Werror -Wextra				\
-	-Wno-address-of-packed-member
+	-Wno-address-of-packed-member			\
+	-Wfloat-equal -Wmissing-declarations		\
+	-Wmissing-format-attribute -Wno-long-long	\
+	-Wredundant-decls -Wshadow 			\
+	-Wno-missing-field-initializers 		\
+	-Wno-missing-braces -Wno-sign-compare 		\
+	-Wno-multichar -Wcast-qual
 
 bin_PROGRAMS = fwts