Xref: utzoo comp.sys.ibm.pc:22312 comp.sys.intel:608 Path: utzoo!utgpu!watmath!mks!egisin From: egisin@mks.UUCP (Eric Gisin) Newsgroups: comp.sys.ibm.pc,comp.sys.intel Subject: Re: correct code for pointer subtraction Summary: Oh my god Message-ID: <609@mks.UUCP> Date: 16 Dec 88 18:06:44 GMT References: <597@mks.UUCP> <8377@bloom-beacon.MIT.EDU> <8455@sequent.UUCP> <2237@iscuva.ISCS.COM> Organization: Mortice Kern Systems, Waterloo, Ont. Lines: 17 In article <2237@iscuva.ISCS.COM>, carlp@iscuva.ISCS.COM (Carl Paukstis) writes: < In article <600@mks.UUCP> egisin@mks.UUCP (Eric Gisin) writes: < .>Please read my code. I have two pointers to "s", a single object. < .>Declaring "s" with 1 or 10000 makes no difference. ... < Of course, the code you posted is NOT legal, since the two pointers in the < example *do not* point inside the same object. You have verified that the < incorrect code is generated when you IN FACT declare "struct six s[10000]"? < If so, it's a bona-fide bug. But if it won't work with your example, the < worst conclusion you can directly draw is that your example is "not < conformant". No, I DO NOT have to verify that it still generates incorrect code when I declare "s" as s[10000]. "diff" is a global function, and could be called from another module with a legal object. A compiler with a dumb linker cannot generate code for diff depending on how it is called in than module.