Visual Studio 2003 and line-ending-agnosticism
- From: Pete Gontier <kokorozashi@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 May 2005 09:43:19 -0700
Some parts of Visual Studio 2003 are more line-ending-agnostic than others.
Consider the following scenario. You have two text files, one of which was
written by a Mac application and has a carriage return at the end of each
line, and the other of which was written by a Windows application and has a
carriage return followed by a line feed at the end of each line. VS2003 will
happily open and edit both of these files. So far so good. Now copy some
text out of the Mac file and paste it into the Windows file. Everything
looks fine, and the editor keeps working just fine, but you have just
entered a world of pain without knowing it. The file now has some lines
which end in the Windows style and some which end in the Mac style. VS2003
will happily save and open this file as many times as you like without ever
letting on that there's anything weird about the file, which might even be
considered a feature. However, in any case, the C++ compiler is not nearly
so cosmopolitan. When it encounters this file, it loses track of what line
number it's on, which means error messages are reported for the wrong line
and the debugger gets sorely confused. You can stare at the code as long as
you like and you will never see with your eyes anything wrong. Eventually,
if you're persistent enough, you will break out a hex editor and discover
what has happened. But by then you will have lost several hours, possibly at
a time when you can ill-afford it.
--
Pete Gontier
http://www.m-audio.com/
.
- Follow-Ups:
- Re: Visual Studio 2003 and line-ending-agnosticism
- From: Phil Frisbie, Jr.
- Re: Visual Studio 2003 and line-ending-agnosticism
- Prev by Date: RE: WinHelp on W2003 SP1
- Next by Date: Re: Visual Studio 2003 and line-ending-agnosticism
- Previous by thread: WinHelp on W2003 SP1
- Next by thread: Re: Visual Studio 2003 and line-ending-agnosticism
- Index(es):
Relevant Pages
|