bugAVR C Runtime Library - Bugs: bug #9704, suggested putc() behavior breaks...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9704: suggested putc() behavior breaks binary transfer

Submitter:  None
Submitted:  Tue 20 Jul 2004 04:06:38 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Thu 22 Jul 2004 11:13:37 AM UTC, comment #1: 

A better description has been added to rev 1.15 of
include/stdio.h (and rev. 1.11.2.4 as well).

Note that the updated documentation will only be reflected
on the web site once a new avr-libc release has been rolled,
as it always shows the docs for the most recent `stable'
release.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 20 Jul 2004 04:06:38 PM UTC, original submission:  

The description and sample code for putc() in stdio.h suggest that the developer should replace newline characters with a carriage return followed by a newline. In embedded environments, particularly for prototyping, it is common to use RS232 to transfer binary data. A putc() implemented as suggested would break any user code that expects values to be transmitted literally.

The documentation should clarify this.

The other issue here is that depending upon the terminal being used, if putc() doesn't mangle newlines, the user needs to provide a carriage return in his printf() strings. This looks ugly and is a hassle especially to people who are used to coding in a Unix environment. Perhaps one fix would be to provide a putascii() function which would be called by puts() and printf() and would mangle the newline (and possibly other) character(s) as necessary. Vanilla putc() would then behave as expected.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-07-22 joerg_wunsch StatusNone Fixed
    Open/ClosedOpen Closed
2004-07-20 joerg_wunsch Assigned toNone joerg_wunsch

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code