Re: Rationale for some rules in style guide

2023-04-12 Thread Brett Lymn
On Wed, Apr 12, 2023 at 01:53:30PM +0300, Valery Ushakov wrote: > > That might have been a concern when all variable definitions had to be > at the beginning of a block and when you were more likely to read > program listings printed out on paper :) This is probably less > relevant now. > It is

Re: Rationale for some rules in style guide

2023-04-12 Thread Robert Elz
Date:Wed, 12 Apr 2023 22:01:36 +0200 From:Reinoud Zandijk Message-ID: | Oh I do that for I think its more clear You really write (and think it is more clear) stuff like: char a; #if sizeof(struct small) == sizeof(char)/* except you can't, I don't

Re: Rationale for some rules in style guide

2023-04-12 Thread Reinoud Zandijk
On Wed, Apr 12, 2023 at 07:40:22PM +0700, Robert Elz wrote: > | On Tue, Apr 11, 2023 at 08:30:19PM +0200, Roland Illig wrote: > | The style guide says: > |When declaring variables in functions declare them sorted by size > > That one ought be deleted, if only because absolutely no-one

Re: Rationale for some rules in style guide

2023-04-12 Thread Robert Elz
| On Tue, Apr 11, 2023 at 08:30:19PM +0200, Roland Illig wrote: | The style guide says: |When declaring variables in functions declare them sorted by size That one ought be deleted, if only because absolutely no-one follows it (properly). To do that, one would need to fill the

Re: Rationale for some rules in style guide

2023-04-12 Thread Joerg Sonnenberger
Am Wed, Apr 12, 2023 at 05:16:55AM -0700 schrieb Carlo Arenas: > On Wed, Apr 12, 2023 at 5:07 AM Joerg Sonnenberger wrote: > > > > Am Wed, Apr 12, 2023 at 09:17:49AM - schrieb Michael van Elst: > > > jo...@bec.de (Joerg Sonnenberger) writes: > > > > > > >Which compiler from this century

Re: Rationale for some rules in style guide

2023-04-12 Thread Carlo Arenas
On Wed, Apr 12, 2023 at 5:07 AM Joerg Sonnenberger wrote: > > Am Wed, Apr 12, 2023 at 09:17:49AM - schrieb Michael van Elst: > > jo...@bec.de (Joerg Sonnenberger) writes: > > > > >Which compiler from this century doesn't allocate stack space > > >independent from the source order? > > > > gcc

Re: Rationale for some rules in style guide

2023-04-12 Thread Joerg Sonnenberger
Am Wed, Apr 12, 2023 at 09:17:49AM - schrieb Michael van Elst: > jo...@bec.de (Joerg Sonnenberger) writes: > > >Which compiler from this century doesn't allocate stack space > >independent from the source order? > > gcc with -O0 and -O1 allocates variables in source order. More by accident,

Re: Rationale for some rules in style guide

2023-04-12 Thread Valery Ushakov
On Wed, Apr 12, 2023 at 07:53:23 +0930, Brett Lymn wrote: > > > then in alphabetical order > > > > Why does it make sense to sort variables in the order 'bottom, left, > > right, top' instead of the natural pronunciation order 'top, left, > > bottom, right', for example? Or 'height, width, x, y'

Re: Rationale for some rules in style guide

2023-04-12 Thread Michael van Elst
jo...@bec.de (Joerg Sonnenberger) writes: >Which compiler from this century doesn't allocate stack space >independent from the source order? gcc with -O0 and -O1 allocates variables in source order. With our notoriously broken gdb, that can be helpful.