Article View: comp.std.c
Article #4047Converting between pointer types
From: Denizen of the Deep
Date: Tue, 19 Sep 1995 19:52
Date: Tue, 19 Sep 1995 19:52
16 lines
1054 bytes
1054 bytes
My reading of the standard is that there's no way to convert between a pointer to a function and a pointer to an object or incomplete type; i.e. doing so results in undefined behavior. My question is this: suppose I am on a machine which has the same representation for all pointer types and I want to write code only for this machine (I don't care about portability). What is the status of my program if it attempts such a conversion, given that I know exactly how the compiler is generating code and I know it does exactly what I want? Is it legal but just not portable, or is it not even technically a legal C program (since the behavior is undefined rather than implementation-defined)? -Jon
Technical Details
Message-ID:
<43n718$ns@Radon.Stanford.EDU>Path:
arc1-ca.pugleaf.net!Xenon.Stanford.EDU!beckerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!Xenon.Stanford.EDU!becker From: becker@Xenon.Stanford.EDU (Denizen of the Deep) Newsgroups: comp.std.c Subject: Converting between pointer types Date: 19 Sep 1995 19:52:08 GMT Organization: Computer Science Department, Stanford University. Message-ID: <43n718$ns@Radon.Stanford.EDU> NNTP-Posting-Host: xenon.stanford.edu