Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

gcc error

Frequent Advisor

gcc error

hello all! I currently need to compile a program using gcc. however that program outputs an error about
_IOREAD undeclared. I noticed that this is because this is not defined in stdio.h. Is there a work around I could use to still be able to compile the program? Is there a flag or option for this?

thanks for any help! :)
Jairo Campana
Trusted Contributor

Re: gcc error

define _IOREAD in stdio.h

see :

or see:
/* @(#)stdio.h 1.1 (Berkeley) 3/9/81 */
/* Modified for Sun: BUFSIZE set to 512. Per Bothner 82/Jun/14 */
/* ifdef Vsystem hack: Bothner June 83 */
#ifdef Vsystem
#define BUFSIZ 512
#define _NFILE 20
# ifndef FILE
extern struct _iobuf {
int _cnt;
char *_ptr;
char *_base;
int _bufsiz;
short _flag;
char _file;
} _iob[_NFILE];
# endif

#define _IOREAD 01
#define _IOWRT 02
#define _IONBF 04
#define _IOMYBUF 010
#define _IOEOF 020
#define _IOERR 040
#define _IOSTRG 0100
#define _IOLBF 0200
#define _IORW 0400
#define NULL 0
#define FILE struct _iobuf
#define EOF (-1)

#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
#define getc(p) (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p))
#define getchar() getc(stdin)
#define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p))
#define putchar(x) putc(x,stdout)
#define feof(p) (((p)->_flag&_IOEOF)!=0)
#define ferror(p) (((p)->_flag&_IOERR)!=0)
#define fileno(p) ((p)->_file)

FILE *fopen();
FILE *fdopen();
FILE *freopen();
long ftell();
char *fgets();

Esteemed Contributor

Re: gcc error


Could be that you have coruped headear files
of your gcc or you just need to patch them.