Skip to content

WIth GCC 14.2.1, build fails with r2proto.c:832:13: error: the comparison will always evaluate as ‘true’ for the address of ‘logdir’ will never be NULL [-Werror=address] #1

Description

@dreirund

WIth GCC 14.2.1, build fails with r2proto.c:832:13: error: the comparison will always evaluate as ‘true’ for the address of ‘logdir’ will never be NULL [-Werror=address]:

/var/cache/makepkg/build/openr2-git/src/openr2/src/r2proto.c: In function ‘open_logfile’:
/var/cache/makepkg/build/openr2-git/src/openr2/src/r2proto.c:832:13: error: the comparison will always evaluate as ‘true’ for the address of ‘logdir’ will never be NULL [-Werror=address]
  832 |         if (!r2chan->r2context->logdir) {
      |             ^
In file included from /var/cache/makepkg/build/openr2-git/src/openr2/src/r2proto.c:52:
/var/cache/makepkg/build/openr2-git/src/openr2/src/openr2/r2context-pvt.h:174:14: note: ‘logdir’ declared here
  174 |         char logdir[OR2_MAX_PATH];
      |              ^~~~~~
/var/cache/makepkg/build/openr2-git/src/openr2/src/r2proto.c:853:51: error: the comparison will always evaluate as ‘true’ for the address of ‘logdir’ will never be NULL [-Werror=address]
  853 |                         r2chan->r2context->logdir ? r2chan->r2context->logdir : currdir,
      |                                                   ^
/var/cache/makepkg/build/openr2-git/src/openr2/src/openr2/r2context-pvt.h:174:14: note: ‘logdir’ declared here
  174 |         char logdir[OR2_MAX_PATH];
      |              ^~~~~~
cc1: all warnings being treated as errors

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions