switch (expression)

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Jul 29 12:43:57 AEST 1988


In article <755 at vsi.UUCP> sullivan at vsi.UUCP (Michael T Sullivan) writes:
>I don't know about casting should be avoided.  I'm looking at shmop(2) manual
>page for our 3B2 (shared memory operation) and it says:
>	"Shmat {which is a char* function -mts} returns the data segment
>	start address of the attached shared memory segment...
>	Otherwise, a value of -1 is returned and errno is set to indicate
>	the error."
>Somebody at AT&T must think casting a pointer to an int (or a long) isn't
>such a bad idea, unless I'm missing something (it has been known to happen).

That's a well-known serious design botch on AT&T's part.
At the time of the UNIX/RT-UNIX/TS merge, when the IPC
stuff first was wedged into USG UNIX 3.0 to make 4.0,
the problem with this practice should have been evident
(unlike the situation with brk(2)).  Therefore it's really
inexcusable.



More information about the Comp.std.c mailing list