vdr-projects / vdr-plugin-epgsearch

Searchtimer and replacement of the VDR program menu
GNU General Public License v2.0
3 stars 5 forks source link

Compile error with GCC 11.1 #1

Closed M-Reimer closed 3 years ago

M-Reimer commented 3 years ago

Hello,

if compiling with GCC 11.1 compilation fails with:

epgsearchext.c: In member function ‘bool cSearchExts::Load(const char*)’:
epgsearchext.c:1427:53: error: ordered comparison of pointer with integer zero (‘char*’ and ‘int’)
 1427 |             while (fgets(buffer, sizeof(buffer), f) > 0) {
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11.1.0/set:60,
                 from conflictcheck.h:30,
                 from conflictcheck.c:26:
M-Reimer commented 3 years ago

Found the mistake on my side. Your current check is "!= 0" while the man page of "fgets" says that "NULL" is returned on error.

Would you prefer this to be replaced with "NULL" in the checks. If so I would create a pull request.

tomjfr commented 3 years ago

Changed in new commit, hope this helps with c++11 and clang also