Commit Graph

19 Commits

Author SHA1 Message Date
Frediano Ziglio
e788e6e476 Remove conversion warnings
Use casts to avoid all that warning.
They should go away once you use more type safe types.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Frediano Ziglio
7b36374170 Adjust some warnings
Remove -Werror and add -fpermissive, this will allow to compile C code with
a GNU C++ compiler.

Ignore warnings as our code use some feature like empty arrays.

Remove warnings not available in C++.

Bump GLIB_VERSION_MAX_ALLOWED to reduce the warning, looks like the
GLib headers for C++ are not able to handle them correctly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Snir Sheriber
c3fb5596c6 Remove -Wchkp warning, deprecated in GCC 9
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-07 13:00:00 +01:00
Eduardo Lima (Etrunko)
1b7c19bc1b m4: Remove repeated warnings suppression
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-02-01 08:48:08 +00:00
Frediano Ziglio
3db256430b build-sys: Do not abort on warnings
This causes some tests to fail when run on Valgrind.
In the code warnings are not supposed to cause crashes.
This change avoid overriding entirely G_DEBUG definition but
just append gc-friendly which make Valgrind more effective.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-04-22 08:44:21 +01:00
Christophe Fergeau
68bc284b52 build-sys: Update to latest ax_valgrind_check.m4
This allows to remove a small hack in server/Makefile.am where we were
using make check-valgrind-memcheck rather than make check-valgrind to
make sure we get a non-0 exit code on failures.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-22 09:34:40 +00:00
Christophe Fergeau
844544f8be build-sys: Add make check-valgrind target
This allows to run automatically our test-suite with valgrind to test
for memory leaks.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-21 16:34:56 +01:00
Christophe Fergeau
f611228bd0 build: Cleanup disabled warnings a bit
Some C-specific warnings were turned off as the spice module used to
ship a C++ spice client. It's long gone, so we can reenable these
warnings.
There were warnings disabled for tunnel support and CEGUI usage which
have both been removed too.
-Wno-format-nonliteral was disabled twice.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-14 09:51:29 +00:00
Frediano Ziglio
46b6372865 build: Disable some newly added warnings
-Wshift-overflow cause an error to be detected in Glib headers.
-Wformat-signedness and -Wnull-dereference probably could be
fixed but currently they produce lot of errors.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-10 12:11:55 +00:00
Frediano Ziglio
12c97d2fea build: Update manywarnings.m4
Allows to catch more issues.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-10 12:11:10 +00:00
Pavel Grunt
58ed103636 Fix missing prototypes
Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-06-15 15:02:42 +01:00
Uri Lublin
b2c48e7eba m4: WARN FLAGS: Drop -Wenum-compare
My RHEL-6 gcc (4.4.7) complains a lot about it:
   cc1: warning: command line option "-Wenum-compare" is
   valid for C++/ObjC++ but not for C

For older gcc version (e.g. 4.4.7), man gcc says
-Wenum-compare is "C++ and Objective-C++ only".

For newer gcc (e.g. 4.9.2), man gcc says
"In C this warning is enabled by -Wall."
2015-03-15 13:57:12 +02:00
Cole Robinson
39733d25f5 m4: Update manywarnings from gnulib
Fixes these noisy errors on Fedora 21:

gcc: warning: switch '-Wmudflap' is no longer supported
2014-10-10 12:39:11 +02:00
Christophe Fergeau
f0336ac832 Use latest warnings.m4 from gnulib
This fixes at least some issues when building with clang
2013-10-10 11:20:08 +02:00
Christophe Fergeau
ceb672bf85 Use hardened linker flags if available
This commit reuse several macros from libvirt to test for
support for "-Wl,-z -Wl,relro", "-Wl,-z -Wl,now" and
"-Wl,--no-copy-dt-needed-entries", and use them if available.
2013-10-10 11:17:52 +02:00
Dunrong Huang
6f4d2c8afb Fix _FORTIFY_SOURCE redefine error
If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine
it, or it will raise a build error as below:

In file included from agent-msg-filter.c:21:0:
../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
agent-msg-filter.c:1:0: note: this is the location of the previous definition

Suggested-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
2013-09-10 07:59:54 +02:00
Alon Levy
d905a1f24c m4/spice-compile-warnings: Squelch _FORTIFY_SOURCE when needed to avoid glibc #warnings.
Fix copied from libvirt, commit by Eric Blake.

glibc 2.15 (on Fedora 17) coupled with explicit disabling of
optimization during development dies a painful death:

/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

Work around this by only conditionally defining _FORTIFY_SOURCE,
in the case where glibc can actually use it.  The trick is using
AH_VERBATIM instead of AC_DEFINE.
2012-06-06 17:32:02 +03:00
Daniel P. Berrange
5e15aa74c6 Disable -Waggregate-return if building with SLIRP
The API design of SLIRP means that it is not practical to use
the -Waggregate-return warning flag. Disable this flag in the
(unlikely) scenario where SLIRP is actually requested at build
time
2012-04-26 18:46:52 +01:00
Daniel P. Berrange
d986fb466b Enable many more compiler warnings
* m4/manywarnings.m4m, m4/warnings.m4: Import GNULIB warnings
  modules
* m4/spice-compile-warnings.m4: Define SPICE_COMPILE_WARNINGS
* configure.ac: Replace compile warning check with a call to
  SPICE_COMPILE_WARNINGS
* client/Makefile.am: Use WARN_CXXFLAGS instead of WARN_CFLAGS

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:25 +01:00