avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] Re: avrdude-dev Digest, Vol 19, Issue 5


From: Lou Cypher
Subject: Re: [avrdude-dev] Re: avrdude-dev Digest, Vol 19, Issue 5
Date: Sat, 14 Aug 2004 13:09:12 +0200

On 14 Aug 2004 at 10:20, Joerg Wunsch wrote:

> IIRC, there's an option where you can tell the run-time system to
> treat all file open operations as binary.  Open modes like "ra" can
> then be used to force text mode.

Visual C/C++ gives a similar option with a global variable _fmode, but I 
would never use such a method myself; I would find it to be cryptic, when 
there's an ISO/ANSI standard that requires just "r" for text (translated) and 
"rb" for binary (untraslated): it's already there, accepted by any 
compiler/target.
I didn't check the behaviour of other compilers like MinGW port, but even 
using it I'd just stick with the "r"/"rb" modes, and I'm sure it will handle 
them properly.
I just have never seen "ra" before, since I've always treated standard 
functions as fopen() with common parameters. My way to determine what's 
"common" is just checking first the ISO/IEC 9899:1999 paper, some books with 
ISO/ANSI coverage, and then some other documents like Visual C/C++ standard 
library documentation and GNU libc one. The option "ra" isn't mentioned by 
any of them, so assume it to be "uncommon".

The fact that in Unix (and similar environments), the text and binary modes, 
are just in the same form makes things undoubtely easier -- and yes, other 
line endings flavors are silly standards, in file formats.
Making software portable isn't always easy (this is self-evident), but I 
presume that at least these minimal differences could be covered with just a 
small effort in following the C standard.

Lou





reply via email to

[Prev in Thread] Current Thread [Next in Thread]