Project

General

Profile

Actions

Bug #15490

open

fm: the comparison will always evaluate as 'true'

Added by Toomas Soome 3 months ago. Updated 3 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

Build error with gcc 12:

    ../common/libseslog.c: In function 'save_logs':
    ../common/libseslog.c:259:34: error: the comparison will always evaluate as 'true' for the address of 'last_log_entry' will never be NULL [-Werror=address]
      259 |         if (data->last_log_entry != NULL &&
          |                                  ^~
    In file included from ../common/libseslog.c:38:
    ../common/libseslog.h:141:14: note: 'last_log_entry' declared here
      141 |         char last_log_entry[MAXNAMELEN]; /* Last entry read, passed in/out */
          |              ^~~~~~~~~~~~~~
    ../common/libseslog.c: In function 'clear_log':
    ../common/libseslog.c:641:34: error: the comparison will always evaluate as 'true' for the address of 'last_log_entry' will never be NULL [-Werror=address]
      641 |         if (data->last_log_entry != NULL &&
          |                                  ^~
    ../common/libseslog.h:141:14: note: 'last_log_entry' declared here
      141 |         char last_log_entry[MAXNAMELEN]; /* Last entry read, passed in/out */
          |              ^~~~~~~~~~~~~~
    ../common/libseslog.c: In function 'access_ses_log':
    ../common/libseslog.c:772:31: error: the comparison will always evaluate as 'false' for the address of 'target_path' will never be NULL [-Werror=address]
      772 |         if (data->target_path == NULL) {
          |                               ^~
    ../common/libseslog.h:138:14: note: 'target_path' declared here
      138 |         char target_path[MAXPATHLEN]; /* Path to device, passed in */
          |              ^~~~~~~~~~~
    cc1: all warnings being treated as errors

Actions

Also available in: Atom PDF