Skip to content

Fails to build with newer versions of GCC due to '-Werror=unterminated-string-initialization' #935

@glaubitz

Description

@glaubitz

Trying to build aws-lc-fips-sys as part of efs-utils fails with:

[   56s]   In file included from /home/abuild/rpmbuild/BUILD/aws-efs-utils-2.4.0-build/efs-utils-v2.4.0/src/proxy/vendor/aws-lc-fips-sys-0.13.9/aws-lc/crypto/fipsmodule/bcm.c:148:
[   56s]   /home/abuild/rpmbuild/BUILD/aws-efs-utils-2.4.0-build/efs-utils-v2.4.0/src/proxy/vendor/aws-lc-fips-sys-0.13.9/aws-lc/crypto/fipsmodule/self_check/self_check.c: In function 'boringssl_self_test_fast':
[   56s]   /home/abuild/rpmbuild/BUILD/aws-efs-utils-2.4.0-build/efs-utils-v2.4.0/src/proxy/vendor/aws-lc-fips-sys-0.13.9/aws-lc/crypto/fipsmodule/self_check/self_check.c:1709:38: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
[   56s]    1709 |   static const uint8_t kAESKey[16] = "BoringCrypto Key";
[   56s]         |                                      ^~~~~~~~~~~~~~~~~~
[   56s]   /home/abuild/rpmbuild/BUILD/aws-efs-utils-2.4.0-build/efs-utils-v2.4.0/src/proxy/vendor/aws-lc-fips-sys-0.13.9/aws-lc/crypto/fipsmodule/self_check/self_check.c:1859:51: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (19 chars into 18 available) [-Werror=unterminated-string-initialization]
[   56s]    1859 |   static const uint8_t kDRBGPersonalization[18] = "BCMPersonalization";
[   56s]         |                                                   ^~~~~~~~~~~~~~~~~~~~
[   56s]   /home/abuild/rpmbuild/BUILD/aws-efs-utils-2.4.0-build/efs-utils-v2.4.0/src/proxy/vendor/aws-lc-fips-sys-0.13.9/aws-lc/crypto/fipsmodule/self_check/self_check.c:1860:38: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
[   56s]    1860 |   static const uint8_t kDRBGAD[16] = "BCM DRBG KAT AD ";
[   56s]         |                                      ^~~~~~~~~~~~~~~~~~
[   56s]   At top level:
[   56s]   cc1: note: unrecognized command-line option '-Wno-c11-extensions' may have been intended to silence earlier diagnostics
[   56s]   cc1: all warnings being treated as errors

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