home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18774 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.1 KB  |  27 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!news.funet.fi!hydra!klaava!lukka
  3. From: lukka@klaava.Helsinki.FI (Tuomas J Lukka)
  4. Subject: Re: sccs eats good code -
  5. Message-ID: <1992Dec22.134740.5332@klaava.Helsinki.FI>
  6. Organization: University of Helsinki
  7. References: <1992Dec21.4396.29992@dosgate>
  8. Distribution: comp
  9. Date: Tue, 22 Dec 1992 13:47:40 GMT
  10. Lines: 15
  11.  
  12. >A simple solution is to replace the original string with something
  13. >like "%w%\H%\M%\S".  Ugly, but it works.  Unfortunately, it is an
  14. >"active" solution - if you don't notice the problem when you write
  15. >the code, you may get unexpected replacements, whereas with a "good"
  16. >system, you would only get the replacements when you want them.
  17.  
  18. Actually, this raises the danger of another problem: 
  19. What if your vendor has some nifty character escape sequence defined
  20. as \H? Or maybe \H=\h on your compiler? The ANSI states that other
  21. escape sequences cause undefined behaviour. A better solution is:
  22. "%w%""H""%""M""%""S"
  23. And this works correctly on any ANSI compiler.
  24.  
  25.     TJL
  26.  
  27.