[gnutls-devel] GnuTLS | Building crau.h (#1889)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue May 19 11:59:45 CEST 2026



Issue created by Bjørn Christensen: https://gitlab.com/gnutls/gnutls/-/work_items/1889



## Description of problem:
Problems building GnuTLS on mac platform.
The code in crau.h seems to have a logic error, lines 253-261

#  ifndef CRAU_MAYBE_UNUSED
#   if defined(__has_c_attribute)
#    if __has_c_attribute (__maybe_unused__)
#     define CRAU_MAYBE_UNUSED [[__maybe_unused__]]
#    endif
#   elif defined(__GNUC__)
#    define CRAU_MAYBE_UNUSED __attribute__((__unused__))
#   endif
#  endif /* CRAU_MAYBE_UNUSED */

In my case when compiling, the code ends up without macro CRAU_MAYBE_UNUSED defined.

that generates compiler errors for all the later uses.

I have solved the problem by adding -DCRAU_MAYBE_UNUSED= to the compilation but is would be nice that  the code defined an empty macro CRAU_MAYBE_UNUSED if it cannot provide an alternative for it.

Could be:
#  ifndef CRAU_MAYBE_UNUSED
#   if defined(__has_c_attribute)
#    if __has_c_attribute (__maybe_unused__)
#     define CRAU_MAYBE_UNUSED [[__maybe_unused__]]
#    else
#     define CRAU_MAYBE_UNUSED
#    endif
#   elif defined(__GNUC__)
#    define CRAU_MAYBE_UNUSED __attribute__((__unused__))
#   else
#    define CRAU_MAYBE_UNUSED
#   endif
#  endif /* CRAU_MAYBE_UNUSED */


## Version of gnutls used:
3.8.13

## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)
sourcecode

## How reproducible:
everytime

Steps to Reproduce:

 * one
 * two
 * three

## Actual results:


## Expected results:

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/work_items/1889
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/sent_notifications/4-5wx2n22mn9a4p6wp25kwc9i7y-a84t7/unsubscribe | Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20260519/50c8c071/attachment-0001.html>


More information about the Gnutls-devel mailing list