diff mbox

[libdrm,1/7] meson, configure: add warning when using undefined preprocessor tokens

Message ID 20180126113047.25658-1-eric.engestrom@imgtec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom Jan. 26, 2018, 11:30 a.m. UTC
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 configure.ac | 2 +-
 meson.build  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Emil Velikov Jan. 26, 2018, 5:14 p.m. UTC | #1
On 26 January 2018 at 11:30, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>  configure.ac | 2 +-
>  meson.build  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 35378b3384290f8e1e26..3fc4e7794cd974171c0a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -197,7 +197,7 @@ dnl skipped and all flags rechecked.  So there's no need to do anything
>  dnl else.  If for any reason you need to force a recheck, just change
>  dnl MAYBE_WARN in an ignorable way (like adding whitespace)
>
> -MAYBE_WARN="-Wall -Wextra \
> +MAYBE_WARN="-Wall -Wextra -Wundef \
>  -Wsign-compare -Werror-implicit-function-declaration \
>  -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
>  -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
> diff --git a/meson.build b/meson.build
> index d7a50cf96f905b53d37a..a410627fbf16a2c6d748 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -203,7 +203,7 @@ if cc.has_function('open_memstream')
>  endif
>
>  warn_c_args = []
> -foreach a : ['-Wall', '-Wextra', '-Wsign-compare',
> +foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef',

Unless we have [m]any undef warnings, I'd just make that Werror=undef,
across build systems.

-Emil
Eric Engestrom Jan. 26, 2018, 5:17 p.m. UTC | #2
On Friday, 2018-01-26 17:14:06 +0000, Emil Velikov wrote:
> On 26 January 2018 at 11:30, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> > Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> > ---
> >  configure.ac | 2 +-
> >  meson.build  | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 35378b3384290f8e1e26..3fc4e7794cd974171c0a 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -197,7 +197,7 @@ dnl skipped and all flags rechecked.  So there's no need to do anything
> >  dnl else.  If for any reason you need to force a recheck, just change
> >  dnl MAYBE_WARN in an ignorable way (like adding whitespace)
> >
> > -MAYBE_WARN="-Wall -Wextra \
> > +MAYBE_WARN="-Wall -Wextra -Wundef \
> >  -Wsign-compare -Werror-implicit-function-declaration \
> >  -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
> >  -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
> > diff --git a/meson.build b/meson.build
> > index d7a50cf96f905b53d37a..a410627fbf16a2c6d748 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -203,7 +203,7 @@ if cc.has_function('open_memstream')
> >  endif
> >
> >  warn_c_args = []
> > -foreach a : ['-Wall', '-Wextra', '-Wsign-compare',
> > +foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef',
> 
> Unless we have [m]any undef warnings, I'd just make that Werror=undef,
> across build systems.

This is what patch 6/7 of this series does.
I chose to make it a two step thing, first enable the warning, fix the
code, and then turn the warning into an error.

I guess I could just skip this patch, and introduce the warning as an
error in 6/7.

> 
> -Emil
Dylan Baker Jan. 26, 2018, 5:46 p.m. UTC | #3
Quoting Eric Engestrom (2018-01-26 09:17:43)
> On Friday, 2018-01-26 17:14:06 +0000, Emil Velikov wrote:
> > On 26 January 2018 at 11:30, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> > > Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> > > ---
> > >  configure.ac | 2 +-
> > >  meson.build  | 2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/configure.ac b/configure.ac
> > > index 35378b3384290f8e1e26..3fc4e7794cd974171c0a 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -197,7 +197,7 @@ dnl skipped and all flags rechecked.  So there's no need to do anything
> > >  dnl else.  If for any reason you need to force a recheck, just change
> > >  dnl MAYBE_WARN in an ignorable way (like adding whitespace)
> > >
> > > -MAYBE_WARN="-Wall -Wextra \
> > > +MAYBE_WARN="-Wall -Wextra -Wundef \
> > >  -Wsign-compare -Werror-implicit-function-declaration \
> > >  -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
> > >  -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
> > > diff --git a/meson.build b/meson.build
> > > index d7a50cf96f905b53d37a..a410627fbf16a2c6d748 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -203,7 +203,7 @@ if cc.has_function('open_memstream')
> > >  endif
> > >
> > >  warn_c_args = []
> > > -foreach a : ['-Wall', '-Wextra', '-Wsign-compare',
> > > +foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef',
> > 
> > Unless we have [m]any undef warnings, I'd just make that Werror=undef,
> > across build systems.
> 
> This is what patch 6/7 of this series does.
> I chose to make it a two step thing, first enable the warning, fix the
> code, and then turn the warning into an error.
> 
> I guess I could just skip this patch, and introduce the warning as an
> error in 6/7.
> 
> > 
> > -Emil

I'd either leave 1/7 as-is or drop it completely, so we can bisect across this
series. I don't care which.

Dylan
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 35378b3384290f8e1e26..3fc4e7794cd974171c0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,7 +197,7 @@  dnl skipped and all flags rechecked.  So there's no need to do anything
 dnl else.  If for any reason you need to force a recheck, just change
 dnl MAYBE_WARN in an ignorable way (like adding whitespace)
 
-MAYBE_WARN="-Wall -Wextra \
+MAYBE_WARN="-Wall -Wextra -Wundef \
 -Wsign-compare -Werror-implicit-function-declaration \
 -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
 -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
diff --git a/meson.build b/meson.build
index d7a50cf96f905b53d37a..a410627fbf16a2c6d748 100644
--- a/meson.build
+++ b/meson.build
@@ -203,7 +203,7 @@  if cc.has_function('open_memstream')
 endif
 
 warn_c_args = []
-foreach a : ['-Wall', '-Wextra', '-Wsign-compare', 
+foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef',
              '-Werror-implicit-function-declaration', '-Wpointer-arith',
              '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes',
              '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',