Re: [HACKERS] Macro From Hell

From: David Hartwig <daveh(at)insightdist(dot)com>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, David Hartwig <daybee(at)bellatlantic(dot)net>, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Macro From Hell
Date: 1998-09-08 14:49:58
Message-ID: 35F54416.4843DB75@insightdist.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas G. Lockhart wrote:

> > > ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1
> > > ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof
> > > (double) -
> > > 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)
> > > - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) ==
> > > sizeof(char)) ?
> > > ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh
> ^^^^^ should perhaps be (long)(ptr)
> > > ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==
> > > sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo
> > > f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?
> > > (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))
> > > : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );
> > > a - 1506-226 (S) The ":" operator is not allowed between "char*" and
> > > "unsigned long".
> > Looks like I am going to have to do another DISABLE_COMPLEX_MACROS
> > entry for that new macro, just like heap_getattr().
>
> The error message indicates that the AIX compiler is complaining about a
> type mismatch within the macro, not the length of the macro itself. Try
> adding that additional coersion and see if it helps. The macro is just a
> bit "thick" (OK, _really_ thick :), so there may be another place in
> there provoking the complaint...
>

That is correct. I was able to do several casts to get it to work this
morning. It is hacked in for now. Basically the problem is this:

ptr = (test) ? (espression resulting in pointer) : (expression
resulting in long)

Our compiler does not like this. Bruce, I can send a patch if you like.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-09-08 15:02:32 Re: [HACKERS] Macro From Hell
Previous Message David Hartwig 1998-09-08 14:41:54 Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7.