[SA-exim] Re: Spamassassin in local_scan

Marc MERLIN marc at merlins.org
Thu, 13 Jun 2002 23:32:41 -0700


On Fri, Jun 14, 2002 at 01:33:30PM +0800, Peter N Lewis wrote:
> >I know it works with gcc and other decent compilers
> >What are you using?
> 
> Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
> Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 
> 19991024 (release)
> 
> It is gcc, but perhaps you are using a 3.x version?
 
Mmmh, no, the ## construct has been in gcc forever
 
> >How about this line:
> >if (sscanf(buffer, #VAR ## ": " ## TYPE, & ## VAR))
> 
> Believe me, I tried everything!  BTW, what is the & ## VAR suppose to 
> do?  Shouldn't that just be &VAR?

My understanding is that in macros, you are supposed to use ## between a
macro name and something you'd want to be next to it.

That said, #VAR ## ": " ## TYPE  makes sense, but indeed,  & ## VAR isn't
needed, I'll remove that one for now.

However, the other ones are really supposed to be there AFAIK.
Unless someone on top of C standards tells me otherwise, I'm enclined to
leave them.
I'll ask around

I also think something is fishy with your gcc, it should *really* accept
that syntax.
 
> Mostly I figured you should know.  Personally, my preferred solution 
> would be to do away with the macros altogether and change them to 
> procedure calls, one each for Integer, Float, and String.

I can't bring myself down to that, it's just too ...stupid...
Man, I hate C :-)

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger marc_f@merlins.org for PGP key