4.8 doesn't throw -Wreturn-type anymore for wrong returns in macros
Bug #1234218 reported by
Lars Karlitski
on 2013-10-02
This bug affects 1 person
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | GLib |
Fix Released
|
Low
|
||
| | glib2.0 (Ubuntu) |
High
|
Unassigned | ||
Bug Description
GLib has a macro g_return_if_fail(), that returns from a function when a precondition isn't met. gcc used to warn when calling it in a function that returns a value, but stopped doing so in 4.8.
$ cat return-warning.c
#include <glib.h>
int function (int c)
{
g_return_if_fail (c > 100);
}
$ gcc-4.7 -c -Wreturn-type `pkg-config --cflags glib-2.0` return-warning.c
return-warning.c: In function ‘function’:
return-
$ gcc-4.8 -c -Wreturn-type `pkg-config --cflags glib-2.0` return-warning.c
$
Matthias Klose (doko)
on 2015-10-02
| affects: | gcc-4.8 (Ubuntu) → glib2.0 (Ubuntu) |
Sebastien Bacher (seb128)
on 2015-10-02
| Changed in glib2.0 (Ubuntu): | |
| status: | New → Fix Committed |
| importance: | Undecided → High |
Bug Watch Updater (bug-watch-updater)
on 2015-10-02
| Changed in glib: | |
| importance: | Unknown → Low |
| status: | Unknown → Fix Released |
Amr Ibrahim (amribrahim1987)
on 2016-03-04
| Changed in glib2.0 (Ubuntu): | |
| status: | Fix Committed → Fix Released |
To post a comment you must log in.

