Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: gcc needs a curly bracket matching/counting function Date: Wed, 21 Dec 2016 08:52:31 -0800 Organization: None to speak of Lines: 17 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="e647705ee050c178d8090e6d328af466"; logging-data="26696"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6/Dgrm0Ja9FQfvMXeDG6b" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Hhfl7AuoMDo04Wr+q4S8dXAwyK8= sha1:W/jBhL1elz2/Qyy2kkbkR3vLdFQ= Xref: csiph.com comp.lang.c:99992 David Brown writes: [...] > You can put things like brackets in macro definitions, but it is usually > regarded as a /really/ bad idea. (I presume that by "brackets" you mean {curly braces}.) Why is it a bad idea? I've seen (and written) plenty of macro definitions like: #define FOO do { /* blah blah */ } while(0) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"