Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.sys.ibm.pc Subject: Re: Reason *not* to get new Borland "Turbo" releases Message-ID: <4592@bsu-cs.UUCP> Date: 4 Nov 88 16:50:21 GMT References: <4203@tekgvs.GVS.TEK.COM> <14725@iuvax.cs.indiana.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 40 In article <14725@iuvax.cs.indiana.edu> bobmon@iuvax.UUCP (RAMontante) writes: >Second of all, I can easily tell MS-generated C code from Borland- >generated C code; both of them *currently* put a "(C) copyright..." >string in the executable, without bothering to mention that they're >doing it. Based on Turbo C 1.0 and Microsoft C 3.0, the story with this embedded copyright notice is as follows. Microsoft C has a null pointer check that is done when your program terminates. At that time the runtime library checks to see if the data stored at location (char *)0 are still unchanged. If they are not, the runtime prints a "Null pointer reference" message before exiting. At location (char *)0 something has to be there to look at, and the Microsoft library contains a module that contains Microsoft's copyright message at that location. If you add your own null pointer checking fuction (I think it's called _nullcheck()), then that copyright message won't be loaded and you will save about 128 bytes: _nullcheck() {} Smart programmers do this to make their executable code a little smaller, provided they have carefully debugged it to remove the possibility of a null pointer reference. There's nothing illegal about doing this, and a careful reading of the manual actually tells you how to do this. Borland's Turbo C 1.0 does not load the copyright message in the same manner. The copyright message is in the start-up code. There's nothing preventing you from re-assembling the startup module without the copyright notice; the manual says nothing about this being wrong or illegal. And if you write your own start-up module, you would naturally not want Borland's copyright message in it at all. The above discussion has nothing to do with whether Borland's new policy is good or bad. -- Rahul Dhesi UUCP: !{iuvax,pur-ee}!bsu-cs!dhesi