[Openchrome-devel] [PATCH] Treat all build warnings as errors
Bartosz
gang65 at wp.pl
Fri Aug 5 02:28:43 UTC 2016
Thanks Xavier.
It will be great to also enable "-Wall" parameter.
http://www.rapidtables.com/code/linux/gcc/gcc-wall.htm
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
2016-08-04 14:33 GMT+02:00 Xavier Bachelot <xavier at bachelot.org>:
> Signed-off-by: Xavier Bachelot <xavier at bachelot.org>
> ---
> I don't know my way through autotools very well, so not sure this is the
> best way, but it works...
>
> src/Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 82224d4..6ff7e31 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -29,7 +29,7 @@ SUBDIRS = xvmc
> BUILT_SOURCES = version.h
> EXTRA_DIST = version.h
> CONFIG_CLEAN_FILES= version.h
> -AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @DRI_CFLAGS@
> +AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @DRI_CFLAGS@ -Werror
> openchrome_drv_la_LTLIBRARIES = openchrome_drv.la
> openchrome_drv_la_LDFLAGS = -module -avoid-version @LIBUDEV_LIBS@
> openchrome_drv_ladir = @moduledir@/drivers
> --
> 2.7.4
>
> _______________________________________________
> Openchrome-devel mailing list
> Openchrome-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/openchrome-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/openchrome-devel/attachments/20160805/def258fa/attachment.html>
More information about the Openchrome-devel
mailing list