* [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
@ 2019-03-20 8:52 Ser, Simon
2019-03-20 9:38 ` Jani Nikula
0 siblings, 1 reply; 8+ messages in thread
From: Ser, Simon @ 2019-03-20 8:52 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org
Enabling -Werror=missing-braces results in this error with Clang:
../tests/kms_vrr.c:203:20: error: suggest braces around
initialization of subobject [-Werror,-Wmissing-braces]
drmVBlank vbl = { 0 };
^
{}
I don't believe there is any value in keeping this, so let's just
disable it.
Signed-off-by: Simon Ser <simon.ser@intel.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 557400a5..bb100b75 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,7 @@ cc_args = [
'-Wno-type-limits',
'-Wno-unused-parameter',
'-Wno-unused-result',
+ '-Wno-missing-braces',
'-Werror=address',
'-Werror=array-bounds',
@@ -45,7 +46,6 @@ cc_args = [
'-Werror=init-self',
'-Werror=int-to-pointer-cast',
'-Werror=main',
- '-Werror=missing-braces',
'-Werror=nonnull',
'-Werror=pointer-to-int-cast',
'-Werror=return-type',
--
2.21.0
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 8:52 [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces Ser, Simon
@ 2019-03-20 9:38 ` Jani Nikula
2019-03-20 10:53 ` Ser, Simon
0 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2019-03-20 9:38 UTC (permalink / raw)
To: Ser, Simon, igt-dev@lists.freedesktop.org
On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> Enabling -Werror=missing-braces results in this error with Clang:
>
> ../tests/kms_vrr.c:203:20: error: suggest braces around
> initialization of subobject [-Werror,-Wmissing-braces]
> drmVBlank vbl = { 0 };
> ^
> {}
>
> I don't believe there is any value in keeping this, so let's just
> disable it.
I fail to come up with examples right now, but I think there are
legitimate cases for the warning.
Arguably the above initializer should be written as simply {} instead of
having the 0 value for initializing the first member which happens to be
a substruct.
BR,
Jani.
>
> Signed-off-by: Simon Ser <simon.ser@intel.com>
> ---
> meson.build | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/meson.build b/meson.build
> index 557400a5..bb100b75 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -38,6 +38,7 @@ cc_args = [
> '-Wno-type-limits',
> '-Wno-unused-parameter',
> '-Wno-unused-result',
> + '-Wno-missing-braces',
> '-Werror=address',
> '-Werror=array-bounds',
> @@ -45,7 +46,6 @@ cc_args = [
> '-Werror=init-self',
> '-Werror=int-to-pointer-cast',
> '-Werror=main',
> - '-Werror=missing-braces',
> '-Werror=nonnull',
> '-Werror=pointer-to-int-cast',
> '-Werror=return-type',
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 9:38 ` Jani Nikula
@ 2019-03-20 10:53 ` Ser, Simon
2019-03-20 12:11 ` Jani Nikula
2019-03-20 13:52 ` Ville Syrjälä
0 siblings, 2 replies; 8+ messages in thread
From: Ser, Simon @ 2019-03-20 10:53 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org, jani.nikula@linux.intel.com
On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > Enabling -Werror=missing-braces results in this error with Clang:
> >
> > ../tests/kms_vrr.c:203:20: error: suggest braces around
> > initialization of subobject [-Werror,-Wmissing-braces]
> > drmVBlank vbl = { 0 };
> > ^
> > {}
> >
> > I don't believe there is any value in keeping this, so let's just
> > disable it.
>
> I fail to come up with examples right now, but I think there are
> legitimate cases for the warning.
>
> Arguably the above initializer should be written as simply {} instead
> of
> having the 0 value for initializing the first member which happens to
> be
> a substruct.
Unfortunately using {} is a GNU extension, and ISO C forbids empty
initializer lists.
Does IGT use un-standardized extensions?
> BR,
> Jani.
>
>
> > Signed-off-by: Simon Ser <simon.ser@intel.com>
> > ---
> > meson.build | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > diff --git a/meson.build b/meson.build
> > index 557400a5..bb100b75 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -38,6 +38,7 @@ cc_args = [
> > '-Wno-type-limits',
> > '-Wno-unused-parameter',
> > '-Wno-unused-result',
> > + '-Wno-missing-braces',
> > '-Werror=address',
> > '-Werror=array-bounds',
> > @@ -45,7 +46,6 @@ cc_args = [
> > '-Werror=init-self',
> > '-Werror=int-to-pointer-cast',
> > '-Werror=main',
> > - '-Werror=missing-braces',
> > '-Werror=nonnull',
> > '-Werror=pointer-to-int-cast',
> > '-Werror=return-type',
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 10:53 ` Ser, Simon
@ 2019-03-20 12:11 ` Jani Nikula
2019-03-20 12:22 ` Petri Latvala
2019-03-21 7:21 ` Ser, Simon
2019-03-20 13:52 ` Ville Syrjälä
1 sibling, 2 replies; 8+ messages in thread
From: Jani Nikula @ 2019-03-20 12:11 UTC (permalink / raw)
To: Ser, Simon, igt-dev@lists.freedesktop.org; +Cc: Petri Latvala
On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
>> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
>> > Enabling -Werror=missing-braces results in this error with Clang:
>> >
>> > ../tests/kms_vrr.c:203:20: error: suggest braces around
>> > initialization of subobject [-Werror,-Wmissing-braces]
>> > drmVBlank vbl = { 0 };
>> > ^
>> > {}
>> >
>> > I don't believe there is any value in keeping this, so let's just
>> > disable it.
>>
>> I fail to come up with examples right now, but I think there are
>> legitimate cases for the warning.
>>
>> Arguably the above initializer should be written as simply {} instead
>> of
>> having the 0 value for initializing the first member which happens to
>> be
>> a substruct.
>
> Unfortunately using {} is a GNU extension, and ISO C forbids empty
> initializer lists.
Right, it's also okay in ISO C++11.
> Does IGT use un-standardized extensions?
I'm pretty sure it does, but I'll defer decisions about this to the IGT
maintainers.
BR,
Jani.
>
>> BR,
>> Jani.
>>
>>
>> > Signed-off-by: Simon Ser <simon.ser@intel.com>
>> > ---
>> > meson.build | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> > diff --git a/meson.build b/meson.build
>> > index 557400a5..bb100b75 100644
>> > --- a/meson.build
>> > +++ b/meson.build
>> > @@ -38,6 +38,7 @@ cc_args = [
>> > '-Wno-type-limits',
>> > '-Wno-unused-parameter',
>> > '-Wno-unused-result',
>> > + '-Wno-missing-braces',
>> > '-Werror=address',
>> > '-Werror=array-bounds',
>> > @@ -45,7 +46,6 @@ cc_args = [
>> > '-Werror=init-self',
>> > '-Werror=int-to-pointer-cast',
>> > '-Werror=main',
>> > - '-Werror=missing-braces',
>> > '-Werror=nonnull',
>> > '-Werror=pointer-to-int-cast',
>> > '-Werror=return-type',
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 12:11 ` Jani Nikula
@ 2019-03-20 12:22 ` Petri Latvala
2019-03-21 7:25 ` Ser, Simon
2019-03-21 7:21 ` Ser, Simon
1 sibling, 1 reply; 8+ messages in thread
From: Petri Latvala @ 2019-03-20 12:22 UTC (permalink / raw)
To: Jani Nikula; +Cc: igt-dev@lists.freedesktop.org
On Wed, Mar 20, 2019 at 02:11:16PM +0200, Jani Nikula wrote:
> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> >> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> >> > Enabling -Werror=missing-braces results in this error with Clang:
> >> >
> >> > ../tests/kms_vrr.c:203:20: error: suggest braces around
> >> > initialization of subobject [-Werror,-Wmissing-braces]
> >> > drmVBlank vbl = { 0 };
> >> > ^
> >> > {}
> >> >
> >> > I don't believe there is any value in keeping this, so let's just
> >> > disable it.
> >>
> >> I fail to come up with examples right now, but I think there are
> >> legitimate cases for the warning.
> >>
> >> Arguably the above initializer should be written as simply {} instead
> >> of
> >> having the 0 value for initializing the first member which happens to
> >> be
> >> a substruct.
> >
> > Unfortunately using {} is a GNU extension, and ISO C forbids empty
> > initializer lists.
>
> Right, it's also okay in ISO C++11.
>
> > Does IGT use un-standardized extensions?
>
> I'm pretty sure it does, but I'll defer decisions about this to the IGT
> maintainers.
We use -std=gnu11.
It's not as an explicit flag anywhere, making it hard to find. It's in
toplevel meson.build, the project() call, default_options:
'c_std=gnu11'
A quick look in autotools reveals that we don't set the std on it at
all. Oh well.
--
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 10:53 ` Ser, Simon
2019-03-20 12:11 ` Jani Nikula
@ 2019-03-20 13:52 ` Ville Syrjälä
1 sibling, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2019-03-20 13:52 UTC (permalink / raw)
To: Ser, Simon; +Cc: igt-dev@lists.freedesktop.org
On Wed, Mar 20, 2019 at 10:53:05AM +0000, Ser, Simon wrote:
> On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> > On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > > Enabling -Werror=missing-braces results in this error with Clang:
> > >
> > > ../tests/kms_vrr.c:203:20: error: suggest braces around
> > > initialization of subobject [-Werror,-Wmissing-braces]
> > > drmVBlank vbl = { 0 };
> > > ^
> > > {}
> > >
> > > I don't believe there is any value in keeping this, so let's just
> > > disable it.
> >
> > I fail to come up with examples right now, but I think there are
> > legitimate cases for the warning.
> >
> > Arguably the above initializer should be written as simply {} instead
> > of
> > having the 0 value for initializing the first member which happens to
> > be
> > a substruct.
>
> Unfortunately using {} is a GNU extension, and ISO C forbids empty
> initializer lists.
>
> Does IGT use un-standardized extensions?
$ git grep '=[ ]*{[ ]*}' | wc -l
195
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 12:11 ` Jani Nikula
2019-03-20 12:22 ` Petri Latvala
@ 2019-03-21 7:21 ` Ser, Simon
1 sibling, 0 replies; 8+ messages in thread
From: Ser, Simon @ 2019-03-21 7:21 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org, jani.nikula@linux.intel.com; +Cc: Latvala, Petri
On Wed, 2019-03-20 at 14:11 +0200, Jani Nikula wrote:
> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> > > On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > > > Enabling -Werror=missing-braces results in this error with
> > > > Clang:
> > > >
> > > > ../tests/kms_vrr.c:203:20: error: suggest braces around
> > > > initialization of subobject [-Werror,-Wmissing-braces]
> > > > drmVBlank vbl = { 0 };
> > > > ^
> > > > {}
> > > >
> > > > I don't believe there is any value in keeping this, so let's
> > > > just
> > > > disable it.
> > >
> > > I fail to come up with examples right now, but I think there are
> > > legitimate cases for the warning.
> > >
> > > Arguably the above initializer should be written as simply {}
> > > instead
> > > of
> > > having the 0 value for initializing the first member which
> > > happens to
> > > be
> > > a substruct.
> >
> > Unfortunately using {} is a GNU extension, and ISO C forbids empty
> > initializer lists.
>
> Right, it's also okay in ISO C++11.
I don't know about C++, but FWIW it's forbidden in ISO C11:
> gcc -std=c11 -Wall -pedantic test.c
test.c: In function ‘main’:
test.c:7:23: warning: ISO C forbids empty initializer braces [-
Wpedantic]
struct thing stuff = {};
> > Does IGT use un-standardized extensions?
>
> I'm pretty sure it does, but I'll defer decisions about this to the
> IGT
> maintainers.
>
> BR,
> Jani.
>
>
> > > BR,
> > > Jani.
> > >
> > >
> > > > Signed-off-by: Simon Ser <simon.ser@intel.com>
> > > > ---
> > > > meson.build | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > diff --git a/meson.build b/meson.build
> > > > index 557400a5..bb100b75 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -38,6 +38,7 @@ cc_args = [
> > > > '-Wno-type-limits',
> > > > '-Wno-unused-parameter',
> > > > '-Wno-unused-result',
> > > > + '-Wno-missing-braces',
> > > > '-Werror=address',
> > > > '-Werror=array-bounds',
> > > > @@ -45,7 +46,6 @@ cc_args = [
> > > > '-Werror=init-self',
> > > > '-Werror=int-to-pointer-cast',
> > > > '-Werror=main',
> > > > - '-Werror=missing-braces',
> > > > '-Werror=nonnull',
> > > > '-Werror=pointer-to-int-cast',
> > > > '-Werror=return-type',
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
2019-03-20 12:22 ` Petri Latvala
@ 2019-03-21 7:25 ` Ser, Simon
0 siblings, 0 replies; 8+ messages in thread
From: Ser, Simon @ 2019-03-21 7:25 UTC (permalink / raw)
To: Latvala, Petri, jani.nikula@linux.intel.com; +Cc: igt-dev@lists.freedesktop.org
On Wed, 2019-03-20 at 14:22 +0200, Petri Latvala wrote:
> On Wed, Mar 20, 2019 at 02:11:16PM +0200, Jani Nikula wrote:
> > On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > > On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> > > > On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > > > > Enabling -Werror=missing-braces results in this error with
> > > > > Clang:
> > > > >
> > > > > ../tests/kms_vrr.c:203:20: error: suggest braces around
> > > > > initialization of subobject [-Werror,-Wmissing-braces]
> > > > > drmVBlank vbl = { 0 };
> > > > > ^
> > > > > {}
> > > > >
> > > > > I don't believe there is any value in keeping this, so let's
> > > > > just
> > > > > disable it.
> > > >
> > > > I fail to come up with examples right now, but I think there
> > > > are
> > > > legitimate cases for the warning.
> > > >
> > > > Arguably the above initializer should be written as simply {}
> > > > instead
> > > > of
> > > > having the 0 value for initializing the first member which
> > > > happens to
> > > > be
> > > > a substruct.
> > >
> > > Unfortunately using {} is a GNU extension, and ISO C forbids
> > > empty
> > > initializer lists.
> >
> > Right, it's also okay in ISO C++11.
> >
> > > Does IGT use un-standardized extensions?
> >
> > I'm pretty sure it does, but I'll defer decisions about this to the
> > IGT
> > maintainers.
>
> We use -std=gnu11.
>
> It's not as an explicit flag anywhere, making it hard to find. It's
> in
> toplevel meson.build, the project() call, default_options:
> 'c_std=gnu11'
All right! It's probably fine to use this extension then.
(I personally prefer to stick to ISO C and POSIX, but the project
preference prevails of course!)
> A quick look in autotools reveals that we don't set the std on it at
> all. Oh well.
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-03-21 7:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-20 8:52 [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces Ser, Simon
2019-03-20 9:38 ` Jani Nikula
2019-03-20 10:53 ` Ser, Simon
2019-03-20 12:11 ` Jani Nikula
2019-03-20 12:22 ` Petri Latvala
2019-03-21 7:25 ` Ser, Simon
2019-03-21 7:21 ` Ser, Simon
2019-03-20 13:52 ` Ville Syrjälä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox