After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753276 - Fix return value errors in camel-imapx-conn-manager.c
Fix return value errors in camel-imapx-conn-manager.c
Product: evolution-data-server
Classification: Platform
Component: general
3.17.x (obsolete)
Other FreeBSD
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Reported: 2015-08-05 09:36 UTC by Ting-Wei Lan
Modified: 2015-08-06 07:13 UTC
See Also:
GNOME target: ---
GNOME version: ---

[PATCH] Bug 753276 - Fix return value error (1.15 KB, patch)
2015-08-05 09:38 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2015-08-05 09:36:48 UTC
Please see the patch. There are two return value errors in camel/providers/imapx/camel-imapx-conn-manager.c.
Comment 1 Ting-Wei Lan 2015-08-05 09:38:15 UTC
Created attachment 308769 [details] [review]
[PATCH] Bug 753276 - Fix return value error
Comment 2 Milan Crha 2015-08-05 09:59:44 UTC
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+)
Comment 3 Ting-Wei Lan 2015-08-05 10:51:22 UTC
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.
Comment 4 Milan Crha 2015-08-06 05:23:35 UTC
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.
Comment 5 Ting-Wei Lan 2015-08-06 06:56:05 UTC
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.
Comment 6 Milan Crha 2015-08-06 07:13:20 UTC
Even if I add the two I do not get those warnings. I filled [1] for a help from the gcc developers: