home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13293 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.1 KB  |  37 lines

  1. Xref: sparky comp.lang.c:13293 comp.std.c:2581
  2. Newsgroups: comp.lang.c,comp.std.c
  3. Path: sparky!uunet!usc!rpi!utcsri!geac!r-node!pseudo!mjn
  4. From: mjn@pseudo.uucp (Murray Nesbitt)
  5. Subject: Re: strcpy implementation question
  6. Organization: Private system in Toronto, ON
  7. Date: Mon, 7 Sep 1992 10:28:36 GMT
  8. Message-ID: <MJN.92Sep7022836@pseudo.uucp>
  9. In-Reply-To: karl@ima.isc.com's message of Thu, 3 Sep 1992 20:56:46 GMT
  10. References: <PINKAS.92Aug24183511@caraway.intel.com>
  11.     <1992Aug26.224904.7671@sneaky.lonestar.org>
  12.     <PINKAS.92Sep2173635@skywalker.intel.com>
  13.     <1992Sep03.205646.11564@ima.isc.com>
  14. Sender: mjn@pseudo.uucp (Murray Nesbitt)
  15. Lines: 20
  16.  
  17.  
  18. karl@ima.isc.com (Karl Heuer) writes:
  19.  
  20. >    #include <stdio.h>
  21. >    char dst[4] = "abc";
  22. >    char src[4] = "";
  23. >    int main(void) {
  24. >        strcpy(dst, src);
  25. >        if (dst[1] != 'b') printf("strcpy() is broken\n");
  26. >        return 0;
  27. >    }
  28. >
  29. >The undocumented side effect caused by the proposed "optimization" would have
  30. >an effect on the execution of this strictly conforming program.
  31.  
  32. Wouldn't this program need to #include <string.h> (or at least have a
  33. declaration for strcpy()) for strict conformance?
  34.  
  35. -- 
  36. Murray
  37.