GNOME Bugzilla – Bug 753276
Fix return value errors in camel-imapx-conn-manager.c
Last modified: 2015-08-06 07:13:20 UTC
Please see the patch. There are two return value errors in camel/providers/imapx/camel-imapx-conn-manager.c.
Created attachment 308769 [details] [review]
[PATCH] Bug 753276 - Fix return value error
Thanks for a bug report and patch. I wish I know how to convince gcc to report such issues. They are pretty simple to detect, still hidden here.
Created commit e6bec28 in eds master (3.17.90+)
After reading gcc/c/c-typeck.c, it seems we should use different gcc options to convert this warning into an error when different standard versions are used:
If we use -std=c89, we can use -Werror=return-type.
If we use -std=c99 or -std=c11, we can use -pedantic-errors.
I do not need to have it as an error, my problem is that I do not see the warning itself at all, gcc doesn't claim anything on stderr (while it claims other warnings, like deprecations, there).
I closely watch the warnings and I try to keep evolution code base compiler-warning-free, though only for those warnings I see.
I found glib/gmessages.h contains this:
/* Suppress warnings when GCC is in -pedantic mode and not -std=c99
#if (__GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
#pragma GCC system_header
so warnings caused by g_return_if_fail and g_return_val_if_fail are suppressed.
Even if I add the two I do not get those warnings. I filled  for a help from the gcc developers: