home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- 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
- From: lukka@klaava.Helsinki.FI (Tuomas J Lukka)
- Subject: Re: sccs eats good code -
- Message-ID: <1992Dec22.134740.5332@klaava.Helsinki.FI>
- Organization: University of Helsinki
- References: <1992Dec21.4396.29992@dosgate>
- Distribution: comp
- Date: Tue, 22 Dec 1992 13:47:40 GMT
- Lines: 15
-
- >A simple solution is to replace the original string with something
- >like "%w%\H%\M%\S". Ugly, but it works. Unfortunately, it is an
- >"active" solution - if you don't notice the problem when you write
- >the code, you may get unexpected replacements, whereas with a "good"
- >system, you would only get the replacements when you want them.
-
- Actually, this raises the danger of another problem:
- What if your vendor has some nifty character escape sequence defined
- as \H? Or maybe \H=\h on your compiler? The ANSI states that other
- escape sequences cause undefined behaviour. A better solution is:
- "%w%""H""%""M""%""S"
- And this works correctly on any ANSI compiler.
-
- TJL
-
-