call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments

作者:fly 发布于:2016-7-22 11:36 分类:Linux

www.forwhat.cn

gcc 新版本编译器对语法检查严格,在源文件 ./tests/ts_calibrate.c 中

// 源文件
// if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {
//     cal_fd = open (calfile, O_CREAT | O_RDWR);
// } else {
//   cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR);
// }
// 需要更改成如下形式
if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {
    cal_fd = open (calfile, O_CREAT | O_RDWR, 0777);
} else {
    cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR, 0777);
}
保存后重新编译即可

发表评论:

 
Powered by emlog sitemap