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 mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to