Skip to content

common.c/.h: warning: '%s' directive argument is null [-Wformat-overflow=] #2585

@desertwitch

Description

@desertwitch

Getting a couple of compiler warnings while building recent master with gcc version 13.2.0 on Slackware 15.1 (-current)

In file included from common.c:21:
common.c: In function 'sendsignalpid':
common.c:1356:25: warning: '%s' directive argument is null [-Wformat-overflow=]
 1356 |                         "%s: ran at least one check, and all such checks "
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/common.h:423:69: note: in definition of macro 'upsdebugx'
  423 |         do { if (nut_debug_level >= (level)) { s_upsdebugx((level), __VA_ARGS__); } } while(0)
      |                                                                     ^~~~~~~~~~~
At top level:
cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-reserved-identifier' may have been intended to silence earlier diagnostics

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-strIssues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocksbugimpacts-release-2.8.2Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks)portabilityWe want NUT to build and run everywhere possible

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions