Page MenuHomeFreeBSD

crypto: avoid warnings about too-long initializer strings
ClosedPublic

Authored by dim on Fri, Dec 26, 12:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 16, 1:41 PM
Unknown Object (File)
Thu, Jan 15, 9:14 PM
Unknown Object (File)
Thu, Jan 15, 6:22 PM
Unknown Object (File)
Wed, Jan 14, 9:38 PM
Unknown Object (File)
Wed, Jan 14, 11:53 AM
Unknown Object (File)
Tue, Jan 13, 7:45 AM
Unknown Object (File)
Tue, Jan 13, 3:45 AM
Unknown Object (File)
Tue, Jan 13, 3:45 AM
Subscribers

Details

Summary

Mark sigma and tau as __non_string, to avoid warnings from
clang 21 similar to:

sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
   53 | static const char sigma[16] = "expand 32-byte k";
      |                               ^~~~~~~~~~~~~~~~~~
sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
   54 | static const char tau[16] = "expand 16-byte k";
      |                             ^~~~~~~~~~~~~~~~~~

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 69469
Build 66352: arc lint + arc unit

Event Timeline

dim requested review of this revision.Fri, Dec 26, 12:14 AM

Fix double word in commit message.

This revision is now accepted and ready to land.Mon, Dec 29, 2:37 PM