cc mishandles *void?
Lyndon Nerenberg
lyndon at cs.AthabascaU.CA
Thu Nov 16 07:05:22 AEST 1989
While compiling bash under Ultrix 2.3 I ran across an interesting
piece of C that chokes cc(1) under Ultrix 2.3, but compiles fine
under SunOS3.5 and under Ultrix 2.3 using gcc.
The idea of passing parameters as 'void *mumble' seems a bit
questionable. Is the compiler correct to complain about this?
Can someone try it under 3.1 and let me know what it says?
Here's an example using a simplified version of the code in question.
The real stuff is around line 49 of unwind_prot.c in the bash 1.04
distribution.
Script started on Wed Nov 15 12:56:05 1989
auvax:/nfs/auvax2/lyndon% cat foo.c
typedef int Function () ;
foo(arg0, arg1, arg2)
Function *arg0;
void *arg1, *arg2;
{
(*arg0)(arg1, arg2);
}
auvax:/nfs/auvax2/lyndon% cc -c foo.c
"foo.c", line 7: arg1 undefined
"foo.c", line 7: arg2 undefined
auvax:/nfs/auvax2/lyndon%
script done on Wed Nov 15 12:56:29 1989
--
Lyndon Nerenberg VE6BBM / Computing Services / Athabasca University
{alberta,decwrl,lsuc}!atha!lyndon || lyndon at cs.AthabascaU.CA
The Connector is the Notwork.
More information about the Comp.unix.ultrix
mailing list