error: call to '__open_missing_mode' declared with attribute error:

今天安装gettext-0.17时,make命令出现了下面的错误,后面找了半天的资料才解决,记录一下:
In file included from /usr/include/fcntl.h:289:0,
from ../gnulib-lib/fcntl.h:27,
from write-catalog.c:25:
In function ‘open’,
inlined from ‘msgdomain_list_print’ at write-catalog.c:223:7:
/usr/include/i386-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
从报错的字面意思应该可以看出来open with O_CREAT or O_TMPFILE in second argument needs 3 arguments这句话的意思是使用open函数时,当第二个参数用O_CREAT时,表示创建文件,需要使用第三个参数将文件赋予权限。定位到write-catalog.c的223行,果然只使用了两个参数,在后面添加0777:
fd = open (filename, O_WRONLY | O_CREAT,0777);

make正常。。。。

你可能感兴趣的:(Linux运维)