Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Tue, 20 Dec 2016 14:53:23 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: gcc needs a curly bracket matching/counting function References: <87zijq5y6s.fsf@bsb.me.uk> Date: Tue, 20 Dec 2016 20:53:23 +0000 Message-ID: <87lgvaiapo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:weTJJ38Ijmig95i4SCgLBMbBPTY= MIME-Version: 1.0 Content-Type: text/plain Lines: 22 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-xsSc/fMOX6xPcdWwZEH/t96rfJdRSPhIldzW3mu9DpYoCRmdyBrvY0SP2xk0sktdr+5EV3LQdWmxLOH!1PS53rBEWvV34RI2Udfz4U/gz18CO8Q248PYydSoQyIn+7JF0vDQtSQwFBq1b2FmlS6V X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1911 Xref: csiph.com comp.lang.c:99935 Keith Thompson writes: > If the code doesn't use macros, digraphs, or trigraphs to hide braces, > existing tools can be used to find any missing braces. If it does, I > probably don't care about fixing it. The only code that I've seen that a) doesn't (ab)use the features you mention above b) confuses bracket matchers (emacs, specifically) #ifdef CAUTIOUS_DOOHICKEY_FROBNICATION if(doohickey != NULL && FROBNICATION_DEPTH < 3) { #else if(doohickey != NULL) { #endif /// Refrobnicate the doohickey frobnicate(doohickey); } That's not a style I would use, or recommend, but I have worked on codebases with constructs like that in it, and sometimes so many that refactoring becomes quite an intrusive change.