[Mesa-dev] [PATCH v2] meson: Add -Werror=return-type when supported.

Matt Turner mattst88 at gmail.com
Fri Oct 19 17:17:29 UTC 2018


On Thu, Oct 18, 2018 at 6:06 PM Kenneth Graunke <kenneth at whitecape.org> wrote:
>
> This warning detects non-void functions with a missing return statement,
> return statements with a value in void functions, and functions with an
> bogus return type that ends up defaulting to int.  It's already enabled
> by default with -Wall.  Generally, these are fairly serious bugs in the
> code, which developers would like to notice and fix immediately.  This
> patch promotes it from a warning to an error, to help developers catch
> such mistakes early.
>
> I would not expect this warning to change much based on the compiler
> version, so hopefully it won't become a problem for packagers/builders.
>
> See the GCC documentation or 'man gcc' for more details:
> https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/Warning-Options.html#index-Wreturn-type

I'm curious what prompted this. Did we actually have a bug that would
have been caught by this?


More information about the mesa-dev mailing list