Article View: gnu.gcc.bug
Article #1061Why does gcc 2.2.2 allow function pointer arithmetic?
From: Jordan K Hubbard
Date: Fri, 04 Sep 1992 09:35
Date: Fri, 04 Sep 1992 09:35
15 lines
761 bytes
761 bytes
/* gcc 2.2.2 allows constructs like: */
main()
{
void (*foo)(), (*bar)();
printf("%x - %x = %x\n", foo, bar, foo - bar);
/* As well as ... */
printf("Yow! This is zero: %d\n", sizeof(*foo));
}
/* no other C compiler tested so far (native solaris 1, hppa, ibm RS600 )
allows this */
Technical Details
Message-ID:
<1992Sep4.093524.11933@lotus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lotus.UUCP!jkhShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lotus.UUCP!jkh From: jkh@lotus.UUCP (Jordan K Hubbard) Subject: Why does gcc 2.2.2 allow function pointer arithmetic? Message-ID: <1992Sep4.093524.11933@lotus.com> Sender: gnulists@ai.mit.edu Organization: Lotus Development Corp. Distribution: gnu Date: Fri, 4 Sep 1992 09:35:24 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 16