Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site ttds.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!decvax!mcvax!enea!ttds!johanw From: johanw@ttds.UUCP (Johan Wide'n) Newsgroups: net.lang.c Subject: Re: New LINT gag wanted Message-ID: <185@ttds.UUCP> Date: Thu, 8-Mar-84 07:20:57 EST Article-I.D.: ttds.185 Posted: Thu Mar 8 07:20:57 1984 Date-Received: Sat, 10-Mar-84 13:19:04 EST References: <4054@edai.UUCP> Organization: Royal Inst. of Techn., Stockholm Lines: 25 Another feature that would be nice to have in connection with braindamaged compilers with sizeof(int) != sizeof(char *) : Lint should tell you when the difference of two pointers is taken. (The result is an int.) To ensure portability we have been forced to hide the diff of pointers in a macro. For a 32-bit pointer, 16-bit int machine this macro casts the pointers into longs before taking the difference of them. This is not a completely satisfactory solution as the difference should indicate the number of objects between pointers, not just the number of bytes. We are fed up with this sort of compiler and now have two compilers on our MC68000-system. One compiler has 16-bit ints the other has 32-bit ints. The 16-bit compiler can be used for showing of benchmarks, the 32-bit is useful for porting programs to the MC68000. Use of the 32-bit compiler requires that one links the programs not with libc but a modified version of libc with rewritten systemcalls. That is: the routine write.s which traps to the write system call must be changed to take account of the fact that it's arguments are write(32-bit, (char *), 32-bit); whereas the system expects write(16-bit, (char *), 16-bit); {decvax,philabs}!mcvax!enea!ttds!johanw Johan Widen