<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 4/29/25 23:01, Collin Funk via
      Gnupg-devel wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20250430040211.782774-1-collin.funk1@gmail.com">
      <pre wrap="" class="moz-quote-pre">* common/ksba-io-support.c (ATTR_NONSTRING): New macro.
(bintoasc): Mark with ATTR_NONSTRING.
(has_only_base64): Use memchr since calling strchr on a non-NUL
terminated string is undefined behavior.
* dirmngr/dns.c (DNS_NONSTRING): New macro.
(dns_aaaa_arpa, dns_sshfp_print): Mark a variable with DNS_NONSTRING.</pre>
    </blockquote>
    <p>The patch as written breaks compatibility with GCC < GCC8 and
      with other compilers because it neglects to define the new macros
      with empty expansions on older or non-GCC compilers.</p>
    <blockquote type="cite"
      cite="mid:20250430040211.782774-1-collin.funk1@gmail.com">
      <pre wrap="" class="moz-quote-pre">[...]
diff --git a/common/ksba-io-support.c b/common/ksba-io-support.c
index 352485ffa..10419ab20 100644
--- a/common/ksba-io-support.c
+++ b/common/ksba-io-support.c
@@ -51,6 +51,9 @@
   #define LF "\n"
 #endif
 
+#if __GNUC__ >= 8
+# define ATTR_NONSTRING __attribute__ ((__nonstring__))
+#endif
 
 /* Data used by the reader callbacks.  */
 struct reader_cb_parm_s
[...]
diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index 5c7bb08d8..bfab59f13 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -131,6 +131,9 @@ typedef int socket_fd_t;
 #if __GNUC__
 #define DNS_NOTUSED __attribute__((unused))
 #define DNS_NORETURN __attribute__((__noreturn__))
+#if __GNUC__ >= 8
+#define DNS_NONSTRING __attribute__((__nonstring__))
+#endif
 #else
 #define DNS_NOTUSED
 #define DNS_NORETURN
<span style="white-space: normal">[...]</span></pre>
    </blockquote>
    <p><br>
    </p>
    <p>-- Jacob<br>
    </p>
  </body>
</html>