Article View: borland.public.cppbuilder.nativeapi
Article #10700Re: exception "catch" clause
From: p Anders
Date: Fri, 26 Mar 2004 14:06
Date: Fri, 26 Mar 2004 14:06
32 lines
2189 bytes
2189 bytes
thanks for the info. "Bob Gonder" <notbg@notmindspring.invalid> wrote in message news:mnt660lm9g2ebth873f7bpb93gcit1j409@4ax.com... > p Anders wrote: > > >I have several macros defined - some use the parenthesis and some don't - > >when are these required and when not? Or maybe they're not required at > >all??? > > In general, no, they aren't required. But... you can get into trouble > in some situations if they aren't used.... Consider > > #define SomeNumber 10+24*13+27 > int i = SomeNumber; /* ok */ > int j = SomeNumber+32; /* ok */ > int k = SomeNumber*7; /* ?? */ > > IOW, where the macro is going to be used as a sub-expression, > parenthesis are good. > > #define condition (i<j) > if condition // if (i<j) ok > if( condition ) // if( (i<j) ) ok > if ! condition // if ! (i<j) not ok > > But code generally doesn't contain parens, so putting parens around a > code macro is probably wrong. > Remember, everything you put in a macro, parens and all, goes into the > expanded code. So, if you can't write the original code with parens, > then you can't write the macro with them either. > >
Technical Details
Message-ID:
<406438f2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4062cd03$1@newsgroups.borland.com> <4062db62$1@newsgroups.borland.com> <mnt660lm9g2ebth873f7bpb93gcit1j409@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d6b749007e0005d0 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-26 06:10:18 PST Reply-To: "p Anders" <paul.anderson@jhuapl.edu> From: "p Anders" <paul.anderson@jhuapl.edu> Newsgroups: borland.public.cppbuilder.nativeapi References: <4062cd03$1@newsgroups.borland.com> <4062db62$1@newsgroups.borland.com> <mnt660lm9g2ebth873f7bpb93gcit1j409@4ax.com> Subject: Re: exception "catch" clause Date: Fri, 26 Mar 2004 09:06:43 -0500 Lines: 34 Organization: JHU/APL X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 128.244.21.78 Message-ID: <406438f2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1080310002 128.244.21.78 (26 Mar 2004 06:06:42 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail