Thread View: comp.sys.ibm.pc.rt
4 messages
4 total messages
Started by Johann Schweigl
Sat, 23 Sep 1989 11:27
void * not handled in AIX C compiler ?
Author: Johann Schweigl
Date: Sat, 23 Sep 1989 11:27
Date: Sat, 23 Sep 1989 11:27
26 lines
1210 bytes
1210 bytes
AIX C allows the use of void functions, and the (void *) typecast.
Declaring a variable as void * does not work. The effect is the same
as if the variable had never been defined. Example:
main() {
void *foo;
int bar;
foo = &bar;
}
results in:
"foo.c", line 6: foo undefined
"foo.c", line 6: warning: illegal combination of pointer and integer, op =
which is not quite correct.
Especially I see no sense behind supporting void * in a typecast but not
in a declaration.
Am I wrong?
Any comments?
--
------------------------------------------------------------------
EDV Ges.m.b.H Vienna Johann Schweigl
Hofmuehlgasse 3 - 5 USENET: johnny@edvvie.at
A-1060 Vienna, Austria Tel: (0043) (222) 59907 257 (8-19 CET)
Re: void * not handled in AIX C compiler ?
Author: Greg Comeau
Date: Tue, 03 Oct 1989 22:30
Date: Tue, 03 Oct 1989 22:30
13 lines
954 bytes
954 bytes
In article <159@eliza.edvvie.at> johnny@edvvie.at (Johann Schweigl) writes:
>AIX C... Declaring a variable as void * does not work. The effect is the same
>as if the variable had never been defined. Example:
> main() { void *foo; int bar; foo = &bar;}
>results in:
>
>"foo.c", line 6: foo undefined
>"foo.c", line 6: warning: illegal combination of pointer and integer, op =
>
>which is not quite correct.
You do not appear to be wrong. Although the warning is approopriate,
the error is not.
Re: void * not handled in AIX C compiler ?
Author: Bill Webb
Date: Wed, 04 Oct 1989 00:00
Date: Wed, 04 Oct 1989 00:00
21 lines
1564 bytes
1564 bytes
> AIX C allows the use of void functions, and the (void *) typecast. > Declaring a variable as void * does not work. The effect is the same > as if the variable had never been defined. ... > ------------------------------------------------------------------ > EDV Ges.m.b.H Vienna Johann Schweigl > Hofmuehlgasse 3 - 5 USENET: johnny@edvvie.at > A-1060 Vienna, Austria Tel: (0043) (222) 59907 257 (8-19 CET) I'd say that you're right. The AOS 4.3 RT hc compilers all compiled the code without problem (except for warnings about not using variable foo). Pcc on the other hand gave exactly the same complaints as the AIX compiler. foo = (void *) &bar; If the AIX compiler claims to be ANSI (I'm not sure if it does), then I'd suggest that you do report it as a bug and see if you can get it fixed. ---------------------------------------------------------------- The above views are my own, not necessarily those of my employer. Bill Webb (IBM AWD Palo Alto), (415) 855-4457). UUCP: ...!uunet!ibmsupt!webb
Re: void * not handled in AIX C compiler ?
Author: John Garnett
Date: Wed, 04 Oct 1989 23:27
Date: Wed, 04 Oct 1989 23:27
16 lines
1279 bytes
1279 bytes
In article <159@eliza.edvvie.at>, johnny@edvvie.at (Johann Schweigl) writes:
> AIX C allows the use of void functions, and the (void *) typecast.
> Declaring a variable as void * does not work. The effect is the same
> as if the variable had never been defined.
This problem appears only in the AIX/RT C Compiler. The AIX PS/2
C compiler does allow void pointers to be declared AND used.
However, both the AIX/RT and AIX PS/2 versions of lint choke
on void pointers.
Somebody want to fix this one?
--
+---------------------------------------------+--------------------------+
| Namenet: John W. Garnett | Base 1.9 |
| Internet: garnett@rpp386.cactus.org | |
| Uucpnet: {bigtex|texbell}!rpp386!garnett | "It's almost binary." |
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads