Skip to content

Compilation of doimage.c fails with gcc version 8.2.1  #16

@garciagorka

Description

@garciagorka

Compiling doimage.c with gcc version 8.2.1 in Linux Arch fails with the following message:

doimage.c: In function ‘main’:
doimage.c:1518:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
  strncpy(in_file, argv[optind], MAX_FILENAME);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
doimage.c:1523:3: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
   strncpy(out_file, argv[optind], MAX_FILENAME);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
doimage.c:1473:4: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
    strncpy(opts.bin_ext_file, optarg, MAX_FILENAME);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This issue was solved already in ARM-software repo in this commit:

doimage: get rid of non null terminated strings by strncpy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions