[Mesa-dev] [PATCH] autoconf: Enable missing-prototypes errors when available.
Lucas Stach
dev at lynxeye.de
Wed Feb 8 11:38:16 PST 2012
CC'ing Ian, as he was the one who added glDrawBuffersNV.
The warning about the missing prototype was there for a long time. Only
now with Werror=missing-prototypes it is fatal for the build.
Am Dienstag, den 31.01.2012, 13:45 +0000 schrieb Jon TURNEY:
> On 27/01/2012 19:58, Eric Anholt wrote:
> > After the removal of the dri driver link test, this should help avoid
> > the original problem that it was designed to catch: The warning about
> > a missing prototype due to typoing a function name scrolling by in the
> > Mesa build spew, and you not noticing until you try to run an
> > application and it falls back to swrast.
> > ---
> > configure.ac | 15 ++++++++++++++-
> > 1 files changed, 14 insertions(+), 1 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 06d400f..0cd8421 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -176,7 +176,20 @@ esac
> >
> > dnl Add flags for gcc and g++
> > if test "x$GCC" = xyes; then
> > - CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
> > + CFLAGS="$CFLAGS -Wall -std=c99"
> > +
> > + # Enable -Werror=implicit-function-declaration and
> > + # -Werror=missing-prototypes, if available, or otherwise, just
> > + # -Wmissing-prototypes. This is particularly useful to avoid
> > + # generating a loadable driver module that has undefined symbols.
> > + save_CFLAGS="$CFLAGS"
> > + AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
> > + CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
> > + CFLAGS="$CFLAGS -Werror=missing-prototypes"
> > + AC_LINK_IFELSE([AC_LANG_PROGRAM()],
> > + AC_MSG_RESULT([yes]),
> > + [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
> > + AC_MSG_RESULT([no])]);
> >
> > # Enable -fvisibility=hidden if using a gcc that supports it
> > save_CFLAGS="$CFLAGS"
>
> Looks like this change breaks compilation of the C dispatch code, see [1], [2].
>
> In file included from glapi_dispatch.c:91:
> ../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
> 'glDrawBuffersNV'
>
>
> [1] http://tinderbox.freedesktop.org/builds/2012-01-31-0012/logs/libGL/#build
> [2]
> http://tinderbox.freedesktop.org/builds/2012-01-31-0012/logs/libGL-indirect-only/#build
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list