Page MenuHome GnuPG

gpg-error.h uses c11 reserved word "noreturn"
Closed, ResolvedPublic

Description

<gpg-error.h> needs to use __noreturn__ instead of noreturn to avoid incompatibilities with C11, and specifically <stdnoreturn.h>. see https://github.com/systemd/systemd/pull/8456

I will attach a patch

Details

Related Objects

Event Timeline

werner added a subscriber: werner.

Oh dear, adding new keywords which have not been reserved in the past was a bad idea by C11. This will eventually require fixes at lot of places because the noreturn attribute is widely used ( other common headers may include the noreturn header as well).

Anyway, for libgpg-error it will be easy to do.

werner changed the task status from Open to Testing.May 30 2018, 5:22 PM

Do you have a need for doing a new release immediately?

werner claimed this task.

Pushed similar changes for GnuPG and libgcrypt (which are actually harmless as it is internal use, not exposed header).

Actually, noreturn isn't a keyword. The keyword is _Noreturn. noreturn is a convenience macro, which is provided in the header stdnoreturn.h. Funny enough, _Noreturn and the macro noreturn will be deprecated with C23 in favor of the new attribute [[noreturn]]. :-)
https://en.cppreference.com/w/c/language/_Noreturn

@ikloecker Thank you for the pointer.
When people will use C23 compiler, there will be no problem (even with non-fixed version). That's good. :-)