Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: GCC compiler question
- To: tlug@example.com
- Subject: Re: tlug: GCC compiler question
- From: Neil Booth <NeilB@example.com>
- Date: Mon, 19 Oct 1998 23:32:30 +0900
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- Organization: ...
- References: <3628A130.90268CF3@example.com> <199810190157.KAA23932@example.com> <13866.55070.954065.698861@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Stephen J. Turnbull wrote: [snip] > and might or might not cause a syntax error depending on whether the > caller's intention was > > if (true) > spin_lock_init(x); > else > { ... } > > (which generates an "unmatched else" syntax error) or not. Neither of > Neil's alternatives work intuitively here. Yes, the "if...else" construct I hadn't thought of, and is what deems the "do..while(0)" necessary I guess. Interestingly, now I start to understand the logic of the semicolon in Pascal, where said problem wouldn't arise, and my {(x)->lock = 0;} would work in all cases. I remember when I learnt Pascal (Delphi), I always found the omission of the ";" before else statements confusing and a PITA, coming from C. This little exercise has taught me that Pascal is the logically correct grammar, and C the dubious one. Thanks Stephen, Neil. --------------------------------------------------------------- Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 Next Meeting: 12 December, 12:30 Tokyo Station Yaesu central gate --------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- References:
- tlug: GCC compiler question
- From: Neil Booth <NeilB@example.com>
- Re: tlug: GCC compiler question
- From: Peter Linsley <plinsley@example.com>
- Re: tlug: GCC compiler question
- From: "Stephen J. Turnbull" <turnbull@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: Books (was Re: tlug: TLUG Finances)
- Next by Date: Re: tlug: kanji or romaji for Japanese? (was: parallel-port IDE)
- Prev by thread: Re: tlug: GCC compiler question
- Next by thread: tlug: DIP switch SCSI ID
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links