On 5/13/02 10:08 PM, "Christopher Browne" <cbbrowne / acm.org> wrote:

> It is unlikely that this has anything to do with GCC; GCC doesn't
> control how characters are interpreted in the compiled code.
> 
> Maybe you should look into what libraries you linked with.  If GCC
> links to one library, with one set of behaviour, and CodeWarrior links
> to another library, _that_ would be the source of the behaviour you
> are observing...

I'm sure the difference *is* in the different versions of stdio that come
with each compiler. I was just treating the libraries as part of the
implementation of the language.

My question, though, was intended to be, "What should Ruby do?"

Let me put it another way. In Ruby, the value of $/ is newline by default.
But the ANSI standard for C++, and presumably for C, says the value of
newline is "implementation defined". I think that's good enough for C, but
the problem domain for Ruby is different.

It's a trivial problem to deal with in Ruby code if you what the convention
is in the files that you are trying to manipulate. It's harder if the files
themselves are inconsistent. And there may be situations where <cr><lf>
really should not be treated as newline, though I can't think of any off
hand.
-- 
Every society honors its live conformists and its dead troublemakers.
-Mignon McLaughlin, author