home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!natinst.com!cs.utexas.edu!uwm.edu!spool.mu.edu!olivea!sgigate!sgi!fido!shankar
- From: shankar@sgi.com (Shankar Unni)
- Newsgroups: comp.sys.sgi
- Subject: Re: Does an Indigo make read-only text segments?
- Message-ID: <1k1kqrINNs19@fido.asd.sgi.com>
- Date: 25 Jan 93 21:07:39 GMT
- References: <1jq5fqINN3hf@larry.cs.ubc.ca>
- Organization: Silicon Graphics, Inc.
- Lines: 17
- NNTP-Posting-Host: boris.wpd.sgi.com
- X-Newsreader: Tin 1.1 PL5
-
- Stephen Samuel (samuel@cs.ubc.ca) wrote:
-
- > char *astring="a constant string";
-
- This is a direct violation of ANSI C right there. The RHS expression
- has a type (by language definition) of "const char *", and therefore
- the LHS *must* be "const char *" (or an explicit cast must be
- introduced).
-
- The only case a compiler may not catch easily is if you stick
- inconsistent declarations in different files and try to link them
- together (at least, it won't be caught for C; for C++, many more of
- these violations are caught due to name mangling and the fact that
- prototypes are mandatory).
- --
- Shankar Unni E-Mail: shankar@sgi.com
- Silicon Graphics Inc. Phone: +1-415-390-2072
-