[6929] in Athena Bugs
DECstation cc bug (pointers to void functions)
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Mon Jan 21 12:17:55 1991
From: nhdoerry@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Cc: nhdoerry@ATHENA.MIT.EDU
Date: Mon, 21 Jan 91 12:16:06 EST
Hi, I have been experiencing the following problem with
the cc compiler on a DECstation 3100:
cc -c -g shcpdeck.c
ccom: Error: shcpdeck.c, line 764: operands of : have incompatible types
mov = (type == 0) ? plt_move : dxf_move;
-----------------------------------------^
ccom: Warning: shcpdeck.c, line 764: illegal combination of pointer and integer, op =
mov = (type == 0) ? plt_move : dxf_move;
-----------------------------------------^
ccom: Error: shcpdeck.c, line 765: operands of : have incompatible types
drw = (type == 0) ? plt_draw : dxf_draw;
-----------------------------------------^
ccom: Warning: shcpdeck.c, line 765: illegal combination of pointer and integer, op =
drw = (type == 0) ? plt_draw : dxf_draw;
-----------------------------------------^
*** Error code 1
`shcpdeck' not remade because of errors
here are the lines
/* initialize function pointers */
mov = (type == 0) ? plt_move : dxf_move;
drw = (type == 0) ? plt_draw : dxf_draw;
where mov and drw are declared as:
void plot_waterline(sdt,ship,type,out,deck)
SDT sdt;
SHIP ship;
int type; /* type = 0 to x-window : type = 1 to out in dxf format */
FILE *out;
DECK deck;
{
void (*mov)(),(*drw)();
double z[STATN],y[STATN],ystrt;
int i,k;
extern int pen_old;
plt_move() and dxf_move() are declared at the top of the program:
void dxf_move();
void dxf_draw();
void plt_move();
void plt_draw();
These lines are from the program located in the 13.ship_dev locker
in the following directory:
/mit/13.ship_dev/shcp/shcp_deck_dxf
The program compiles fine on the VAXstation 3100 and also on the
DECstation 3100 with the cc2.1 compiler.
Norbert H. Doerry
x3-0050 (7-321)