delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/10/19/16:58:24

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Ironport-SBRS: None
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2H8AQDnWCVW/52AA4BegzaBQ4JcuzMBDYFahh4CgT04FAEBAQEBAQEDgQeELgEBBDpPCxgJExIPBQ08E4gbAxIFv1INhH4BAQgCIYZ3hH6CUIJEgxqBFAWOB4gciyiBbZRWh0ofAQFChCMeNIVnAQEB
X-IronPort-AV: E=Sophos;i="5.17,704,1437462000";
d="scan'208";a="2612863"
Date: Mon, 19 Oct 2015 13:58:02 -0700
From: Larry Doolittle <ldoolitt AT recycle DOT lbl DOT gov>
To: "Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Subject: Re: [geda-user] does anyone like -Wdeclaration-after-statement
Message-ID: <20151019205802.GA6798@recycle.lbl.gov>
References: <CAC4O8c9rjGEsy6NP8kFz5jKRy51NOndbhU37gUa_Om70qbxVKg AT mail DOT gmail DOT com>
<CABuVarJiWLMNh+cMcNF4vpv3aAm-eHKazu+i=F00WcBWF_=Oag AT mail DOT gmail DOT com>
<CAC4O8c8n7RdxJ6Diq7UYkQAka16zwVQ_E+Wr0JGbiy3_VQw0jw AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAC4O8c8n7RdxJ6Diq7UYkQAka16zwVQ_E+Wr0JGbiy3_VQw0jw@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Friends -

On Mon, Oct 19, 2015 at 12:31:35PM -0800, Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
> > As for me, I always use -Wall enabled, it really helps write reliable
> > code (and frequently brokes compilation of some projects :-).
> My too.  I also use -Wextra.  Neither of those imply
> -Wdeclaration-after-statement,
> it's that unpopular.  I like to use -Werror as well and pcb is pretty close
> to clean enough

-O2 -Wall -Wextra -Wshadow -pedantic --std=c99

and the --std=c99 part explicitly allows declarations after statements.
I don't know what to suggest if a compiler doesn't follow an ISO standard
16 years after it's published.

Sometimes I'll also add
-Wsign-compare -Wundef -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Winline
The amazing thing is that clang folks will accept all of those options, too,
so they can no longer be labeled purely gcc-specific.

  - Larry

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019