• Arnd Bergmann's avatar
    ACPI: disable -Wstringop-truncation · a3403d30
    Arnd Bergmann authored
    gcc -Wstringop-truncation warns about copying a string that results in a
    missing nul termination:
    
    drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table':
    drivers/acpi/acpica/tbfind.c:60:9: error: 'strncpy' specified bound 6 equals destination size [-Werror=stringop-truncation]
       60 |         strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/acpi/acpica/tbfind.c:61:9: error: 'strncpy' specified bound 8 equals destination size [-Werror=stringop-truncation]
       61 |         strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The code works as intended, and the warning could be addressed by using
    a memcpy(), but turning the warning off for this file works equally well
    and may be easier to merge.
    
    Fixes: 47c08729 ("ACPICA: Fix for LoadTable operator, input strings")
    Link: https://lore.kernel.org/lkml/CAJZ5v0hoUfv54KW7y4223Mn9E7D4xvR7whRFNLTBqCZMUxT50Q@mail.gmail.com/#tSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    a3403d30
Makefile 2.88 KB