[Mesa-dev] [PATCH 1/2] autoconf: Make the build fail on missing prototypes when possible.

Kenneth Graunke kenneth at whitecape.org
Tue Jan 24 10:19:40 PST 2012


On 01/24/2012 10:09 AM, Eric Anholt wrote:
> You don't want to continue on when you've used something that is
> probably a typo of a real symbol, or maybe just using the wrong
> signature.
> ---
>   configure.ac |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 18a40fc..74e5fe4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -176,7 +176,7 @@ esac
>
>   dnl Add flags for gcc and g++
>   if test "x$GCC" = xyes; then
> -    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
> +    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Werror=missing-prototypes -std=c99"
>
>       # Enable -fvisibility=hidden if using a gcc that supports it
>       save_CFLAGS="$CFLAGS"

I believe this will break builds with GCC 4.2 and earlier.  You might 
want to check if the flag is supported first.  Also, 
-Werror=missing-prototypes implies -Wmissing-prototypes, so you can drop 
that if you like (but not a big deal either way).

We should definitely add this flag where possible.


More information about the mesa-dev mailing list