compile tslib1.4,----error: call to ‘__open_missing_mode’ declared with attribute error

problem:
---------------------
ts_calibrate.c: In function ‘main’:
ts_calibrate.c:234: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
In file included from /usr/include/fcntl.h:205,
                 from /usr/include/sys/fcntl.h:1,
                 from ts_calibrate.c:20:
In function ‘open’,
    inlined from ‘main’ at ts_calibrate.c:227:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
In function ‘open’,
    inlined from ‘main’ at ts_calibrate.c:229:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[2]: *** [ts_calibrate.o] Error 1
make[2]: Leaving directory `/root/Qt_Tools/tslib/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Qt_Tools/tslib'
make: *** [all] Error 2
[email protected]:/root/Qt_Tools/tslib

---------------------------------------------


solution:

root@xx-desktop:~/Qt_Tools/tslib# gedit ./tests/ts_calibrate.c&

go to line227 &&line 229,


        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));
        }


 Because GCC strict syntax error checking.When using then OPEN function,the 2th parameter using "O_CREAT",you must add the 3th parameter ---0777.

發佈了33 篇原創文章 · 獲贊 1 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章