]> arthur.barton.de Git - ngircd-alex.git/commit
Disable GCC -Wformat-truncation when suported
authorAlexander Barton <alex@barton.de>
Thu, 18 Jan 2024 21:39:10 +0000 (22:39 +0100)
committerAlexander Barton <alex@barton.de>
Thu, 18 Jan 2024 21:49:48 +0000 (22:49 +0100)
commit1d527eaf17435089e70b530955e271bbd0440fe4
tree64d3b1262aec1178e48f088131b48032304636d1
parentd702ebab0ad69905293466594359645835ba65b5
Disable GCC -Wformat-truncation when suported

Pass -Wno-format-truncation when this is supported by GCC so silence
warnings like this:

  conf.c: In function ‘Read_Config’:
  conf.c:985:60: warning: ‘snprintf’ output may be truncated before
                 the last format character [-Wformat-truncation=]
    985 |                         snprintf(file, sizeof(file), "%s/%s",
        |                                                            ^
  conf.c:985:25: note: ‘snprintf’ output 2 or more bytes (assuming 257)
                 into a destination of size 256
    985 |                         snprintf(file, sizeof(file), "%s/%s",
        |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    986 |                                  Conf_IncludeDir, entry->d_name);
        |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The warning is correct, but this is basically why we use snprintf() in
the first place.
configure.ng