Skip to content

Build fails #1

Description

@phodina

Hi,

there's an issue with 'sprintf' issue.

  CC      sha256.c
  CC      aml_chksum.c
gcc -c -Wall -Werror -pedantic -std=c99 -O2 -I. aml_chksum.c -o aml_chksum.o
gcc -c -Wall -Werror -pedantic -std=c99 -O2 -I. sha256.c -o sha256.o
aml_chksum.c: In function ‘printf_sha256_sum’:
aml_chksum.c:21:3: error: ‘sprintf’ argument 3 overlaps destination object ‘str’ [-Werror=restrict]
   21 |   sprintf(str, "%s%02x", str, sum[index]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aml_chksum.c:17:7: note: destination object referenced by ‘restrict’-qualified argument 1 was declared here
   17 |  char str[SHA256_SUM_LEN * 2 + 1];
      |       ^~~
cc1: all warnings being treated as errors
make: *** [Makefile:28: aml_chksum.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions