home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sgi / 19100 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.1 KB

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