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: Peter Linsley <plinsley@example.com>
- Date: Mon, 19 Oct 1998 14:45:40 +0900
- Content-Type: text/plain; charset=US-ASCII
- In-reply-to: Your message of "Mon, 19 Oct 1998 11:13:24." <3.0.6.32.19981019111324.00968100@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Hello, > >If we were to declare the macro as follows: > > > >#define spin_lock_init(x) { (x)->lock = 0; } > > > >Then this would expand to > > > >if (true) > > { (x)->lock = 0; } > > Wouldn't it expand to this? > > if (true) > { (x)->lock = 0; }; Very true. The above would expand to: if (true) { (x)->lock = 0; }; Which causes 2 problems I can think of. One is that it introduces a redundant statement, and the other is that it can cause compile errors depending on the context of the statement. Consider: if (true) { (x)->lock = 0; }; else do_something_else (); Regards, Peter -- Peter Linsley Oracle Corporation Japan --------------------------------------------------------------- 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:
- Re: tlug: GCC compiler question
- From: Darren Cook <darren@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: tlug: NFS question
- Next by Date: Re: tlug: GCC compiler question
- Prev by thread: Re: tlug: GCC compiler question
- Next by thread: Re: tlug: GCC compiler question
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links