Re: Rationale for some rules in style guide

2023-04-13 Thread Robert Elz
Date:Thu, 13 Apr 2023 17:45:54 +0200 From:Reinoud Zandijk Message-ID: | So not so strict no Not strict, not even very close I suspect - but nor is anyone else. Even those who think they're following the style guide (for this) aren't (in general - they may sometime

Re: Rationale for some rules in style guide

2023-04-13 Thread Reinoud Zandijk
Hi Robert, On Thu, Apr 13, 2023 at 04:03:38AM +0700, Robert Elz wrote: > 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: > >

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 fo

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 declarat

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 doesn'

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.

Re: Rationale for some rules in style guide

2023-04-11 Thread Mouse
> Which compiler from this century doesn't allocate stack space > independent from the source order? At a minimum, the one that shipped with 5.2. According to --version, it is gcc (GCC) 4.1.3 20080704 prerelease (NetBSD nb3 2007) which is well within this century, and, on amd64, this progra

Re: Rationale for some rules in style guide

2023-04-11 Thread Joerg Sonnenberger
Am Wed, Apr 12, 2023 at 07:53:23AM +0930 schrieb Brett Lymn: > 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 > > > > What is the purpose of this rule, and is it still useful? I'd

Re: Rationale for some rules in style guide

2023-04-11 Thread Brett Lymn
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 > > What is the purpose of this rule, and is it still useful? I'd rather see > the variables grouped by topic. If that rule's purpose is to

Re: Rationale for some rules in style guide

2023-04-11 Thread Mouse
> The style guide says: >> Avoid initializing variables in the declarations > Why? Well, I didn't write the style guide, so I'm not authoritative on questions of why something is there. And, it's a _guide_, not _mandates_. Every style rule I've ever seen, except really vague ones like "write rea