← Back to team overview

desktop-packages team mailing list archive

[Bug 1234218] [NEW] 4.8 doesn't throw -Wreturn-type anymore for wrong returns in macros

 

You have been subscribed to a public bug:

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-warning.c:6:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
$ gcc-4.8 -c -Wreturn-type `pkg-config --cflags glib-2.0` return-warning.c 
$

** Affects: glib2.0 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
4.8 doesn't throw -Wreturn-type anymore for wrong returns in macros
https://bugs.launchpad.net/bugs/1234218
You received this bug notification because you are a member of Desktop Packages, which is subscribed to glib2.0 in Ubuntu.