On Wed, 28 Jan 2026 20:59, Jacob Bachmeyer said:

> NULL?  Perhaps a better solution would be to change the "if (err)" to
> "if (err || !keyblock)" or the more verbose "if (err != 0 || keyblock

In this case you may have ERR == 0 and need to make sure that ERR is
set.  

> shortcoming in the analyzer:  does log_assert crash the program on an
> assertion failure?  Does the analyzer know that?  If not, a NULL

This is the macro:

  # ifdef GPGRT_HAVE_MACRO_FUNCTION
  #  define log_assert(expr)                                      \
    ((expr)                                                       \
     ? (void) 0                                                   \
     : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))

and this is the prototype:
  
  void _gpgrt_log_assert (const char *expr, const char *file, int line,
                          const char *func) GPGRT_ATTR_NORETURN;
  
with:

/* The noreturn attribute.  */
#if _GPG_ERR_GCC_VERSION >= 20500
# define GPGRT_ATTR_NORETURN   __attribute__ ((__noreturn__))
#else
# define GPGRT_ATTR_NORETURN
#endif

So gcc should be able to know this.


Shalom-Salam,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein

Attachment: openpgp-digital-signature.asc
Description: PGP signature

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel

Reply via email to