Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 6/2/24 06:53, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >>> On Mon, Feb 05, 2024 at 12:18:19PM -0500, Stefan Hajnoczi wrote: C99 mixed declarations support interleaving of local variable declarations and code. The coding

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-06 Thread Philippe Mathieu-Daudé
On 6/2/24 06:53, Markus Armbruster wrote: Daniel P. Berrangé writes: On Mon, Feb 05, 2024 at 12:18:19PM -0500, Stefan Hajnoczi wrote: C99 mixed declarations support interleaving of local variable declarations and code. The coding style "generally" forbids C99 mixed declarations with some

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-06 Thread Stefan Hajnoczi
On Mon, 5 Feb 2024 at 12:19, Stefan Hajnoczi wrote: > > C99 mixed declarations support interleaving of local variable > declarations and code. > > The coding style "generally" forbids C99 mixed declarations with some > exceptions to the rule. This rule is not checked by checkpatch.pl and >

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, Feb 05, 2024 at 12:18:19PM -0500, Stefan Hajnoczi wrote: >> C99 mixed declarations support interleaving of local variable >> declarations and code. >> >> The coding style "generally" forbids C99 mixed declarations with some >> exceptions to the rule. This

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Alex Bennée
Stefan Hajnoczi writes: > C99 mixed declarations support interleaving of local variable > declarations and code. > > The coding style "generally" forbids C99 mixed declarations with some > exceptions to the rule. This rule is not checked by checkpatch.pl and > naturally there are violations in

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Daniel P . Berrangé
On Mon, Feb 05, 2024 at 02:06:39PM -0500, Stefan Hajnoczi wrote: > On Mon, 5 Feb 2024 at 13:16, Samuel Tardieu wrote: > > > > > > Daniel P. Berrangé writes: > > > > > $ gcc -Wall -Wuninitialized -o jump jump.c > > > > Note that many GCC warnings don't trigger if you don't enable > >

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Stefan Hajnoczi
On Mon, 5 Feb 2024 at 13:16, Samuel Tardieu wrote: > > > Daniel P. Berrangé writes: > > > $ gcc -Wall -Wuninitialized -o jump jump.c > > Note that many GCC warnings don't trigger if you don't enable > optimizations. In the case you exhibit, adding -O is enough to get > a sensible warning: > > $

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Samuel Tardieu
Daniel P. Berrangé writes: $ gcc -Wall -Wuninitialized -o jump jump.c Note that many GCC warnings don't trigger if you don't enable optimizations. In the case you exhibit, adding -O is enough to get a sensible warning: $ gcc -Wall -O -o jump jump.c jump.c: In function ‘main’:

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Peter Maydell
On Mon, 5 Feb 2024 at 17:41, Daniel P. Berrangé wrote: > Rather than accept the status quo and remove the coding guideline, > I think we should strengthen the guidelines, such that it is > explicitly forbidden in any method that uses 'goto'. Personally > I'd go all the way to

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Daniel P . Berrangé
On Mon, Feb 05, 2024 at 12:18:19PM -0500, Stefan Hajnoczi wrote: > C99 mixed declarations support interleaving of local variable > declarations and code. > > The coding style "generally" forbids C99 mixed declarations with some > exceptions to the rule. This rule is not checked by checkpatch.pl

[PATCH] docs/style: allow C99 mixed declarations

2024-02-05 Thread Stefan Hajnoczi
C99 mixed declarations support interleaving of local variable declarations and code. The coding style "generally" forbids C99 mixed declarations with some exceptions to the rule. This rule is not checked by checkpatch.pl and naturally there are violations in the source tree. While contemplating