[comp.unix.questions] Porting to a 3b2 -- Ok, I give.

kehoe@scotty.dccs.upenn.edu (Brendan Kehoe) (08/22/90)

 I owe an apology to all of the AT&T 3b2 fans out there -- I made a really
harsh judgement against your machine when in fact the problems I was having
porting a program to that machine were purely based in my naivete' with
pre-Ansi compilers.
 My problem with aggregate initialization was fixed by slapping a 'static'
in front of each one.
 The problem declaring the integer-pointer array was fixed by simply not
declaring the argument to it:

Ansi:	int (*step[])(int *) = { *step1, ..., *step7 };
Nansi:	static int (*step[])() = { *step1, ..., *step7 };

 I also had to move the predeclarations out of the header that was being
read into each file and down into the code where it was actually referenced
(aka doing int step1(), ..., step7(); inside the function's definition).
 Another problem I came upon was the use of the =- operator .. I had to do
false=(-1); to avoid this.
 I was also bitten by not declaring a float-returning function after I'd
taken the prototype out of the header..once I did extern float func(); I
was fine.

 So I've been educated -- I was spoiled with gcc & V2 of Kernigan & Ritchie;
bless me father for I have sinned.
 Thanks to all those that (whether politely or not) reminded me that ANSI's
still a really new concept.

Brendan Kehoe | Soon: brendan@cs.widener.edu
For now: kehoe@scotty.dccs.upenn.edu | Or: bkehoe@widener.bitnet