Makefile: add -Wno-stringop-truncation for y.tab.o
authorJens Axboe <axboe@kernel.dk>
Wed, 25 Jan 2023 03:54:48 +0000 (20:54 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 25 Jan 2023 04:07:37 +0000 (21:07 -0700)
commit5ca54c1ba2db849dfaef5fe3aec60329b3df0bd1
tree8cfea69a8c2ecf01083e276aa8ca8a5f055a7abe
parent13bc47b65d32df6fd212c4687c7fd29b4ab7c09d
Makefile: add -Wno-stringop-truncation for y.tab.o

This file is auto-generated, and it currently spews the following
warning for me:

In function ‘setup_to_parse_string’,
    inlined from ‘evaluate_arithmetic_expression’ at y.tab.c:1571:2:
y.tab.c:1559:9: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
 1559 |         strncpy(lexer_input_buffer, string, len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
y.tab.c:1556:19: note: length computed here
 1556 |         if (len > strlen(string))
      |                   ^~~~~~~~~~~~~~

when compiled with:

gcc (Debian 12.2.0-14) 12.2.0

Just set -Wno-stringop-truncation unconditionally in the Makefile for
this file, don't think there's any point in checking if this warning
has been enabled manually.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile
configure