Re: [HACKERS] Macro From Hell

From: dg(at)informix(dot)com (David Gould)
To: daybee(at)bellatlantic(dot)net (David Hartwig)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Macro From Hell
Date: 1998-09-08 18:17:32
Message-ID: 9809081817.AA20767@hawk.oak.informix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> This is a very recent addition at line 664 of copy.c It will not
> compile on AIX 4.1 Help!
>
> gmake[2]: Entering directory `/gnu/postgresql-6.4f/src/backend/commands'
>
> xlc -I../../include -I../../backend -qchars=signed -qmaxmem=8192
> -qhalt=w -qsrcmsg -qcheck=divzero -I/usr/local/include -I.. -c
> copy.c -o copy.o
> 664 | ptr = (
> ((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
> 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".
> gmake[2]: *** [copy.o] Error 1
>

This should not compile anywhere really. The trinary operator must return one
and only one type. That is for:

(condition) ? (t_result) : (f_result)

both t_result and f_result must be of the same type.

-dg

David Gould dg(at)informix(dot)com 510.628.3783 or 510.305.9468
Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612
- If simplicity worked, the world would be overrun with insects. -

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Hartwig 1998-09-08 19:04:01 Re: [HACKERS] index fix report
Previous Message Paul A Vixie 1998-09-08 17:35:57 Re: CIDR/IP types. Was: [GENERAL] big numbers