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

Re: conflicting types for `read'



--- Caffeinate The World <mochaexpress@xxxxxxxxx> wrote:
> # uname -a
> NetBSD ns01 1.6 NetBSD 1.6 (ns01-1.6) #1: Mon Nov 25 17:03:01 CST
> 2002 
>    root@ns01:/usr/src/1.6/sys/arch/alpha/compile/ns01-1.6 alpha
> 
> I get the following error during compile:
> 
> # gmake
> ./compile qmail-getpw.c `cat sql.headers`
> In file included from sql.h:6,
>                  from qmail-getpw.c:17:
> /usr/include/unistd.h:136: conflicting types for `read'
> readwrite.h:4: previous declaration of `read'
> /usr/include/unistd.h:148: conflicting types for `write'
> readwrite.h:5: previous declaration of `write'
> qmail-getpw.c: In function `main':
> qmail-getpw.c:92: warning: return type of `main' is not `int'
> gmake: *** [qmail-getpw.o] Error 1
[...]

I ended up changing:

# cat readwrite.h
#ifndef READWRITE_H
#define READWRITE_H

/*
extern int read();
extern int write();
*/

/* Thai */
#include <unistd.h>

#endif
---end---

Now compiles went through fine. I'm not sure if that was the right
thing to do or not.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com