[Top][All Lists]

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

Where is the error (stdout)

From: Royce Pereira
Subject: Where is the error (stdout)
Date: Fri, 7 Feb 2020 16:38:20 +0530


I am using Avr-gcc-9.1.0

Here's some code (just cut paste from AVR-lib):

//      .......
#include <stdio.h>
//      ......

void uart_putchar(char c, FILE *stream)
 if (c == '\n')
uart_putchar('\r', stream);
 loop_until_bit_is_set(UCSRA, UDRE);
 UDR = c;
 return ;
//set stream pointer
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);

I am getting this warning:

In file included from PkLoad-6D-Ser-72x72x65-1214.c:12:
PkLoad-6D-Ser-72x72x65-1214.c:86:42: warning: initialization of 'int (*)(char,  struct __file *)' from incompatible pointer type 'void (*)(char,  FILE *)' {aka 'void (*)(char,  struct __file *)'} [-Wincompatible-pointer-types]

The code compiles (but for this warning) and works too, on hardware.

This code worked fine in older version of AVR-GCC (4.6 and earlier)

I ignored this warning for a long time. 
Recently, I  got curious as to the nature of the error.

So what has changed recently ? Thanks!

Best Regards,

-- Royce Pereira

reply via email to

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