Hi there,
While compiling a makefile on ubuntu 12.04 LTS (64-bit) encountered with this error:
HTML Code:
gcc -c -O -DLinux -I /usr/include/readline -I ./inc f_evt.c
In file included from /usr/include/fcntl.h:252:0,
from ./inc/f_evt.h:10,
from f_evt.c:43:
In function ‘open',
inlined from ‘f_evt_put_open' at f_evt.c:738:37:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:45:26: error: call to ‘__open_too_many_args' declared with attribute error: open can be called either with 2 or 3 arguments, not more
make: *** [f_evt.o] Error 1
HTML Code:
f_evt.c: 738: if((ps_chan->l_channel_no=open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode))== -1)
HTML Code:
__errordecl (__open_too_many_args,"open can be called either with 2 or 3 arguments, not more");
fcntl2.h:45 : open (const char *__path, int __oflag, ...)
{
if (__va_arg_pack_len () > 1)
__open_too_many_args ();
if (__builtin_constant_p (__oflag))
{
if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
{
__open_missing_mode ();
return __open_2 (__path, __oflag);
}
return __open_alias (__path, __oflag, __va_arg_pack ());
}
HTML Code:
f_evt.h : 10 : #include <fcntl.h>
HTML Code:
f_evt.c : 43 : #include "f_evt.h"
with the following declarations In function ‘open':
HTML Code:
CHARS c_file[80]; /*Name of file*/
#define PUT__CRT_FLAG O_CREAT|O_RDWR
#define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH /* rw-r--r-- */
CHARS c_mode[80];
How do I fix it? Thanks in advance.