[gnutls-devel] GnuTLS | lib: Fix Wunterminated-string-initialization warnings (!2029)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Oct 15 02:41:40 CEST 2025



Merge request https://gitlab.com/gnutls/gnutls/-/merge_requests/2029 was reviewed by Daiki Ueno

--
  
Daiki Ueno started a new discussion on lib/accelerated/x86/x86-common.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/2029#note_2821357418

 > -	const char text[64] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 > -			      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
 > +	const char text[64] __attribute__((nonstring)) =

I have a slight concern on assuming `__attribute__((nonstring))` is always available; a more portable way to do this is to include "attribute.h" and use `ATTRIBUTE_NONSTRING`. However, in this use-case, I would rather write:
```c
const char text[SHA1_BLOCK_SIZE + 1/*NUL*/] = "...";
```
as the `padlock_sha1_blocks` below only takes 64 bytes from the input as commented.


-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/2029
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20251015/b2588af4/attachment.html>


More information about the Gnutls-devel mailing list