pointers is pointers (a cautionary tale)

R. Kym Horsell vu0310 at bingvaxu.cc.binghamton.edu
Wed Aug 29 13:05:09 AEST 1990


I once (and, luckily, only one) had to convert a large C program
from something that ran fairly well on a VAX to a DG MV 20000 (*not*
a 2000). Without a handy-dandy document at hand I quickly found
a mysterious problem with (char *) vs other pointers -- the
program tended to consequently bomb at the drop of a hat.

Solution -- get the thing to work in TURBOC (VAX C didn't have
prototyping at that time -- under Eunice (Ultrix was not
available to me at that time)) with prototypes for *every*
procedure in the whole program. A little lex job was ideal
for finding all the appropriate headers (ctags didn't find
all the parameter defs) and assembling them into, as I recall,
a rather large header file that was subsequently included in
all relevant C sources.

Still under TURBO all appropriate pointer problems were found
and appropriate casts installed (too bad this couldn't be
easily done in Lex too -- there were *quite* a few of these
guys).

The program was then moved back to the 20000 and voila! No problems!

The move from VAX -> 20000 was worth it as well; the program
ran about 10 times faster...

-Kym Horsell



More information about the Comp.lang.c mailing list