Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: Thought on an ANSI lint Message-ID: <9685@smoke.BRL.MIL> Date: 22 Feb 89 22:24:14 GMT References: <1057@vsi.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: comp Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <1057@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: - I am postulating that it would be helpful to have a lint -option that make string literals "array of const char" rather -than "array of char" and do type checking on that basis. This is basically a good idea, since attempts to modify string literals are non-portable. -The Committee apparently considered this for the language itself -but eventually rejected it (maybe some ANSI-kind-of-people could -comment on this). Perhaps they rejected it because it would have -required that old code be retrofitted with /const/ everywhere, -and they felt this was too high a burden to place on those using -a new compiler. No, the main counterargument was that there is a lot of existing code that depends on the ability to modify string literals (e.g. mktemp() on UNIX), so compilers for those clientele would best preserve that property.