[Openchrome-devel] [PATCH] Treat all build warnings as errors
Xavier Bachelot
xavier at bachelot.org
Fri Aug 5 15:09:30 UTC 2016
On 05/08/2016 04:40, Bartosz wrote:
> Hi
> In attachment you have all warnings which was produced by using "-Wall"
>
> We could always silent some types of warnings if we think it is not needed.
> For example to silent all [-Wunused-variable] warnings:
>
> -Werror -Wall -Wno-unused-variable
>
> Best Regards
> Bartosz
>
> 2016-08-05 4:28 GMT+02:00 Bartosz <gang65 at wp.pl <mailto:gang65 at wp.pl>>:
>
> Thanks Xavier.
>
> It will be great to also enable "-Wall" parameter.
> http://www.rapidtables.com/code/linux/gcc/gcc-wall.htm
> <http://www.rapidtables.com/code/linux/gcc/gcc-wall.htm>
> https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
> <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>
>
> -Wall turns on the following warning flags:
>
> -Waddress
> -Warray-bounds=1 (only with -O2)
> -Wbool-compare
> -Wc++11-compat -Wc++14-compat
> -Wchar-subscripts
> -Wcomment
> -Wduplicate-decl-specifier (C and Objective-C only)
> -Wenum-compare (in C/ObjC; this is on by default in C++)
> -Wformat
> -Wimplicit (C and Objective-C only)
> -Wimplicit-int (C and Objective-C only)
> -Wimplicit-function-declaration (C and Objective-C only)
> -Winit-self (only for C++)
> -Wlogical-not-parentheses
> -Wmain (only for C/ObjC and unless -ffreestanding)
> -Wmaybe-uninitialized
> -Wmemset-elt-size
> -Wmemset-transposed-args
> -Wmisleading-indentation (only for C/C++)
> -Wmissing-braces (only for C/ObjC)
> -Wnarrowing (only for C++)
> -Wnonnull
> -Wnonnull-compare
> -Wopenmp-simd
> -Wparentheses
> -Wpointer-sign
> -Wreorder
> -Wreturn-type
> -Wsequence-point
> -Wsign-compare (only in C++)
> -Wsizeof-pointer-memaccess
> -Wstrict-aliasing
> -Wstrict-overflow=1
> -Wswitch
> -Wtautological-compare
> -Wtrigraphs
> -Wuninitialized
> -Wunknown-pragmas
> -Wunused-function
> -Wunused-label
> -Wunused-value
> -Wunused-variable
> -Wvolatile-register-var
>
>
> It will keep code cleaner, and will give you a message if something
> suspicious will happen.
>
> Also there will be a lot of warnings which will need to be resolved.
> Fortunately fixing warnings will be a good task for novice developer.
>
> What do you think about enabling "-Wall"?
>
> Best Regards
> Bartosz
>
>
Hi,
Enabling -Wall is probably a good idea, but we need to first fix all the
warnings then enable it. If we do it the other way, we'll be stuck with
build failures until all the warnings are fixed.
We probably want to also change the CFLAGS for the xvmc and tools
subdirs Makefiles.
I suggest we use https://bugs.freedesktop.org/show_bug.cgi?id=96399 to
track this issue. I already attached some patches there.
Regards,
Xavier
More information about the Openchrome-devel
mailing list