Re: [PATCHv2 wayland 0/8] wayland-scanner: produce code with c99 initializers

2018-06-20 Thread Emil Velikov
On 20 June 2018 at 11:23, Pekka Paalanen  wrote:
> On Tue, 19 Jun 2018 17:43:47 +0100
> Emil Velikov  wrote:
>
>> On 18 June 2018 at 11:36, Pekka Paalanen  wrote:
>> > On Thu, 14 Jun 2018 16:49:37 +0100
>> > Emil Velikov  wrote:
>> >
>> >> Hi all,
>> >>
>> >> Here's a take v2 of the series, with the following changes:
>> >>  - don't trim trailing NULL entries from the wl_interfaces* array
>> >>  - updated tests - separate patches to ease review, to be squashed
>> >>
>> >> On the question of why, despite the aesthetics these patches make the
>> >> generated files actually understandable by a human being...
>> >
>> > Hi Emil,
>> >
>> > on the previous round, this concern was raised:
>> >
>> Thanks, did not spot that one.
>>
>>
>> > On Tue, 13 Feb 2018 13:36:06 +
>> > Daniel Stone  wrote:
>> >
>> >> But that being said, my worry is that we don't actually control the
>> >> compilation environment for the scanner output. Scanner output
>> >> currently compiles with '-pedantic -ansi -Wall -Wextra' (at least,
>> >> when inline is defined). This patch changes that requirement, and I
>> >> worry that - like previous discussions on changing scanner output -
>> >> that upgrading Wayland would lead to people hitting compilation
>> >> failures.
>> >
>> > What is your rationale for that being a non-issue?
>> >
>> According to [1] GCC has supported designated initializers since v3.0,
>> released some 17 years ago [2].
>> Clang has supported them from a very early age. On the Windows front
>> MSVC 2013 introduced support and it EOL.
>>
>> Other less common compilers (say the Sun/Oracle or Intel ones) are
>> fine as well - although I cannot give you exact details.
>>
>> In other words unless someone does one of the following two they're
>> perfectly fine.
>>  - uses unsupported (ancient?) compiler, or
>>  - explicitly sets -pedantic -ansi _and_ -Werror
>>
>> In the case they do, they should seriously reconsider what they're
>> inflicting on themselves.
>> Both from functionality and security POV.
>
> Ok. So '-pedantic -ansi' will still compile, even if with warnings?
> Ansi being equivalent to -std=c90 it seems.
>
You can easily check that with something like the following.

cd $wayland-repo
apply patches
cd tests/data
echo "#include "small-server.h" >> ff.c
echo "int main(void) { return 0; }" >> ff.c
gcc -pedantic -ansi -Dinline="" -I. example-code.c ff.c
-lwayland-server -o foobar


-Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCHv2 wayland 0/8] wayland-scanner: produce code with c99 initializers

2018-06-20 Thread Pekka Paalanen
On Tue, 19 Jun 2018 17:43:47 +0100
Emil Velikov  wrote:

> On 18 June 2018 at 11:36, Pekka Paalanen  wrote:
> > On Thu, 14 Jun 2018 16:49:37 +0100
> > Emil Velikov  wrote:
> >  
> >> Hi all,
> >>
> >> Here's a take v2 of the series, with the following changes:
> >>  - don't trim trailing NULL entries from the wl_interfaces* array
> >>  - updated tests - separate patches to ease review, to be squashed
> >>
> >> On the question of why, despite the aesthetics these patches make the
> >> generated files actually understandable by a human being...  
> >
> > Hi Emil,
> >
> > on the previous round, this concern was raised:
> >  
> Thanks, did not spot that one.
> 
> 
> > On Tue, 13 Feb 2018 13:36:06 +
> > Daniel Stone  wrote:
> >  
> >> But that being said, my worry is that we don't actually control the
> >> compilation environment for the scanner output. Scanner output
> >> currently compiles with '-pedantic -ansi -Wall -Wextra' (at least,
> >> when inline is defined). This patch changes that requirement, and I
> >> worry that - like previous discussions on changing scanner output -
> >> that upgrading Wayland would lead to people hitting compilation
> >> failures.  
> >
> > What is your rationale for that being a non-issue?
> >  
> According to [1] GCC has supported designated initializers since v3.0,
> released some 17 years ago [2].
> Clang has supported them from a very early age. On the Windows front
> MSVC 2013 introduced support and it EOL.
> 
> Other less common compilers (say the Sun/Oracle or Intel ones) are
> fine as well - although I cannot give you exact details.
> 
> In other words unless someone does one of the following two they're
> perfectly fine.
>  - uses unsupported (ancient?) compiler, or
>  - explicitly sets -pedantic -ansi _and_ -Werror
> 
> In the case they do, they should seriously reconsider what they're
> inflicting on themselves.
> Both from functionality and security POV.

Ok. So '-pedantic -ansi' will still compile, even if with warnings?
Ansi being equivalent to -std=c90 it seems.

I can accept that. Is anyone against this change?


Thanks,
pq


> 
> -Emil
> 
> [1] https://gcc.gnu.org/c99status.html
> [2] https://gcc.gnu.org/releases.html



pgpFvYAZUwePL.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCHv2 wayland 0/8] wayland-scanner: produce code with c99 initializers

2018-06-19 Thread Emil Velikov
On 18 June 2018 at 11:36, Pekka Paalanen  wrote:
> On Thu, 14 Jun 2018 16:49:37 +0100
> Emil Velikov  wrote:
>
>> Hi all,
>>
>> Here's a take v2 of the series, with the following changes:
>>  - don't trim trailing NULL entries from the wl_interfaces* array
>>  - updated tests - separate patches to ease review, to be squashed
>>
>> On the question of why, despite the aesthetics these patches make the
>> generated files actually understandable by a human being...
>
> Hi Emil,
>
> on the previous round, this concern was raised:
>
Thanks, did not spot that one.


> On Tue, 13 Feb 2018 13:36:06 +
> Daniel Stone  wrote:
>
>> But that being said, my worry is that we don't actually control the
>> compilation environment for the scanner output. Scanner output
>> currently compiles with '-pedantic -ansi -Wall -Wextra' (at least,
>> when inline is defined). This patch changes that requirement, and I
>> worry that - like previous discussions on changing scanner output -
>> that upgrading Wayland would lead to people hitting compilation
>> failures.
>
> What is your rationale for that being a non-issue?
>
According to [1] GCC has supported designated initializers since v3.0,
released some 17 years ago [2].
Clang has supported them from a very early age. On the Windows front
MSVC 2013 introduced support and it EOL.

Other less common compilers (say the Sun/Oracle or Intel ones) are
fine as well - although I cannot give you exact details.

In other words unless someone does one of the following two they're
perfectly fine.
 - uses unsupported (ancient?) compiler, or
 - explicitly sets -pedantic -ansi _and_ -Werror

In the case they do, they should seriously reconsider what they're
inflicting on themselves.
Both from functionality and security POV.

-Emil

[1] https://gcc.gnu.org/c99status.html
[2] https://gcc.gnu.org/releases.html
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCHv2 wayland 0/8] wayland-scanner: produce code with c99 initializers

2018-06-18 Thread Pekka Paalanen
On Thu, 14 Jun 2018 16:49:37 +0100
Emil Velikov  wrote:

> Hi all,
> 
> Here's a take v2 of the series, with the following changes:
>  - don't trim trailing NULL entries from the wl_interfaces* array
>  - updated tests - separate patches to ease review, to be squashed
> 
> On the question of why, despite the aesthetics these patches make the
> generated files actually understandable by a human being...

Hi Emil,

on the previous round, this concern was raised:

On Tue, 13 Feb 2018 13:36:06 +
Daniel Stone  wrote:

> But that being said, my worry is that we don't actually control the
> compilation environment for the scanner output. Scanner output
> currently compiles with '-pedantic -ansi -Wall -Wextra' (at least,
> when inline is defined). This patch changes that requirement, and I
> worry that - like previous discussions on changing scanner output -
> that upgrading Wayland would lead to people hitting compilation
> failures.

What is your rationale for that being a non-issue?


Thanks,
pq


pgpoIY5a5Lf4G.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCHv2 wayland 0/8] wayland-scanner: produce code with c99 initializers

2018-06-14 Thread Emil Velikov
Hi all,

Here's a take v2 of the series, with the following changes:
 - don't trim trailing NULL entries from the wl_interfaces* array
 - updated tests - separate patches to ease review, to be squashed

On the question of why, despite the aesthetics these patches make the
generated files actually understandable by a human being...

Thanks
Emil

Emil Velikov (8):
  scanner: use c99 initializers for the wl_interface * array
  fixup! scanner: use c99 initializers for the wl_interface * array
  scanner: use c99 initializers for the request/events arrays
  fixup! scanner: use c99 initializers for the request/events arrays
  scanner: use c99 initializers for the interface symbols
  fixup! scanner: use c99 initializers for the interface symbols
  scanner: initialize .{method,event}_count via ARRAY_SIZE
  fixup! scanner: initialize .{method,event}_count via ARRAY_SIZE

 src/scanner.c   |  32 +--
 tests/data/example-code.c   | 557 
 tests/data/small-code-core.c|  31 +--
 tests/data/small-code.c |  31 +--
 tests/data/small-private-code.c |  31 +--
 5 files changed, 339 insertions(+), 343 deletions(-)

-- 
2.16.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel