This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
m68k: conflicting types for 'read'
- From: Anders Montonen <Anders dot Montonen at iki dot fi>
- To: newlib at sourceware dot org
- Date: Sun, 3 Aug 2014 13:48:24 +0300
- Subject: m68k: conflicting types for 'read'
- Authentication-results: sourceware.org; auth=none
Hi,
When trying to compile newlib 2.1.0 for a m68k-unknown-elf target using GCC 4.9.1 (same behaviour with GCC 4.8.3), the build fails with an error about conflicting types for the read function. Newlib 2.0.0 compiles without errors.
/Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/./gcc/xgcc -B/Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/./gcc/ -nostdinc -B/Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/m68k-elf/newlib/ -isystem /Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/m68k-elf/newlib/targ-include -isystem /Users/anders/work/toolchain/gcc/4.9.1/gcc-4.9.1/newlib/libc/include -B/Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/m68k-elf/libgloss/m68k -L/Users/anders/work/toolchain/gcc/4.9.1/m68k-elf/m68k-elf/libgloss/libnosys -L/Users/anders/work/toolchain/gcc/4.9.1/gcc-4.9.1/libgloss/m68k -B/Users/anders/local/m68k-elf/bin/ -B/Users/anders/local/m68k-elf/lib/ -isystem /Users/anders/local/m68k-elf/include -isystem /Users/anders/local/m68k-elf/sys-include -g -O2 -g -O2 -mcpu=51qe -DHOSTED=1 -I. -I../../../../../gcc-4.9.1/libgloss/m68k/.. -c ../../../../../gcc-4.9.1/libgloss/m68k/io-read.c -o hosted-read.o
../../../../../gcc-4.9.1/libgloss/m68k/io-read.c:33:9: error: conflicting types for 'read'
ssize_t read (int fd, void *buf, size_t count)
^
In file included from /Users/anders/work/toolchain/gcc/4.9.1/gcc-4.9.1/newlib/libc/include/sys/unistd.h:8:0,
from /Users/anders/work/toolchain/gcc/4.9.1/gcc-4.9.1/newlib/libc/include/unistd.h:4,
from ../../../../../gcc-4.9.1/libgloss/m68k/io-read.c:17:
/Users/anders/work/toolchain/gcc/4.9.1/gcc-4.9.1/newlib/libc/include/sys/unistd.h:144:25: note: previous declaration of 'read' was here
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte ));
Regards,
Anders Montonen