[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [bug #49447] Example code for uart_putchar() has error in
From: |
Norman Dunbar |
Subject: |
[avr-libc-dev] [bug #49447] Example code for uart_putchar() has error in recursive call |
Date: |
Wed, 26 Oct 2016 11:57:59 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 |
URL:
<http://savannah.nongnu.org/bugs/?49447>
Summary: Example code for uart_putchar() has error in
recursive call
Project: AVR C Runtime Library
Submitted by: normandunbar
Submitted on: Wed 26 Oct 2016 11:57:57 AM GMT
Category: Documentation
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Documentation
Status: None
Percent Complete: 0%
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 2.0.0
Fixed Release: None
_______________________________________________________
Details:
Good Afternoon All,
I have checked the bug database for anything relating to uart_putchar() and
found two references that do not cover the following.
In the example code given in Note 2 for "Running stdio without malloc()" in
the section covering the "<stdio.h>" header features, the recursive call to
uart_putchar() is missing the second "stream" parameter.
The example given is:
int
uart_putchar(char c, FILE *stream)
{
if (c == '\n')
uart_putchar('\r');
loop_until_bit_is_set(UCSRA, UDRE);
UDR = c;
return 0;
}
And I'm sure it should be:
int
uart_putchar(char c, FILE *stream)
{
if (c == '\n')
uart_putchar('\r', stream);
...
}
The example given just prior to the above section is correct in that it does
pass the second parameter.
Cheers,
Norm.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?49447>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [avr-libc-dev] [bug #49447] Example code for uart_putchar() has error in recursive call,
Norman Dunbar <=