Re: [HACKERS] Macro From Hell - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Macro From Hell
Date
Msg-id 199809081540.LAA10703@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Macro From Hell  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
List pgsql-hackers
> > > ((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...

Fixed.  Need to cast the sizeof(char) entry to long.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CIDR/IP types. Was: [GENERAL] big numbers
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Macro From Hell