Failure of \"long x(cp) char * cp; { return *((long *) cp); }\" is a bug?
Rick Genter
rgenter at BBN-LABS-B.ARPA
Mon Jun 30 05:54:14 AEST 1986
I don't think you can call that a compiler bug. There are machines where
returning the long pointed at by a character pointer makes no sense (e.g.,
PDP-10). This is one of those cases that lint calls questionable, and
rightfully so.
In any case, you provided a cast, which implies that "you know what you are
doing." It's no more a compiler bug for your example to trap than it is for
main ()
{
* (long *) main = 0x12345678;
}
to trap on any machine that protects text space from user writes.
--------
Rick Genter BBN Laboratories Inc.
(617) 497-3848 10 Moulton St. 6/512
rgenter at labs-b.bbn.COM (Internet new) Cambridge, MA 02238
rgenter at bbn-labs-b.ARPA (Internet old) linus!rgenter%BBN-LABS-B.ARPA (UUCP)
More information about the Comp.lang.c
mailing list