a freaky bug involving g++ and ^M

March 2nd, 2004 at 11:21 pm

I’m now compiling some C++ code developed in MSVC++ under g++ (on RedHat Linux). The weirdest thing happens !

On MSVC++ (Win2K) it runs fine. When I compile and run with g++ one of my internal assertions fails for some bizzare reason. So, I went to set some printouts in the source file, and to make it more organized I removed all the ^M chars (Windows inserts CR-LF line ends, Unix/Linux only LF) with a script I have. Well, with ^Ms removed, the program runs normally after compiling.

WHAAAAA??????

FFS, the ^M can affect compilation, but runtime ?! Some g++ bug ? Geezers…

No related posts.

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)