Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #100855

Re: gcc needs a curly bracket matching/counting function

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.lang.c
Subject Re: gcc needs a curly bracket matching/counting function
Date 2017-01-02 11:16 +0100
Organization A noiseless patient Spider
Message-ID <o4d97c$b2v$1@dont-email.me> (permalink)
References (8 earlier) <o3edqe$dg$1@dont-email.me> <ec15ifFofgkU1@mid.individual.net> <kfnd1gby3cq.fsf@x-alumni2.alumni.caltech.edu> <ecj8esF5ig7U5@mid.individual.net> <kfnh95hu64h.fsf@x-alumni2.alumni.caltech.edu>

Show all headers | View raw


On 02/01/17 11:07, Tim Rentsch wrote:
> Ian Collins <ian-news@hotmail.com> writes:
> 
>> On 12/29/16 01:40 PM, Tim Rentsch wrote:
>>> Ian Collins <ian-news@hotmail.com> writes:
>>>
>>>> On 12/22/16 06:24 AM, BartC wrote:
>>>>> On 21/12/2016 17:04, Keith Thompson wrote:
>>>>>> BartC <bc@freeuk.com> writes:
>>>>>>
>>>>>>> If you forget the braces, it won't tell you as it knows nothing about
>>>>>>> your rule, unless it can't match them.  You can also put in extra braces,
>>>>>>> and that's OK provided the extra brace is matched elsewhere.
>>>>>>
>>>>>> So don't do that.
>>>>>
>>>>> "So don't make mistakes"
>>>>>
>>>>> Brilliant!
>>>>
>>>> It's called writing unit tests...
>>>
>>> Unit tests aren't going to give any help for code that
>>> doesn't compile.
>>
>> But they will if you put a matching brace in the wrong place...
> 
> This sounds like a joke.  Anyone whose code is so convoluted that
> fixing a brace mismatch has any significant chance of putting a
> matching brace in the wrong place has much deeper problems than
> just where the brace should go.
> 

I've seen code that bad.  Mind you, there were no unit tests to help -
it's hard to imagine a combination of disciplined programming with solid
unit tests, and the kind of slap-dash programming where someone has
added a brace "because the code compiles if I put it there".

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: gcc needs a curly bracket matching/counting function Ian Collins <ian-news@hotmail.com> - 2016-12-22 18:10 +1300
  Re: gcc needs a curly bracket matching/counting function Ian Collins <ian-news@hotmail.com> - 2016-12-29 14:50 +1300
    Re: gcc needs a curly bracket matching/counting function Tim Rentsch <txr@alumni.caltech.edu> - 2017-01-02 02:07 -0800
      Re: gcc needs a curly bracket matching/counting function David Brown <david.brown@hesbynett.no> - 2017-01-02 11:16 +0100
  Re: gcc needs a curly bracket matching/counting function Tim Rentsch <txr@alumni.caltech.edu> - 2016-12-28 16:40 -0800

csiph-web