🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5729

Re: Thought on an ANSI lint

#5729
From: Doug Gwyn
Date: Wed, 22 Feb 1989 22:24
19 lines
1343 bytes
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.
Technical Details
Message-ID: <9685@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn
References: <1057@vsi.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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) <gwyn>)
Distribution: comp
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 19