Nikos Mavrogiannopoulos <[email protected]> writes:

> Thank you. I've committed a fix at:
> https://gitlab.com/gnutls/gnutls/merge_requests/614

Good. And you'll trigger a new test run when it's in?

>> The compilation flag -Wundef would have caught this. 
>
> I have never tried it, but it looks easy to fail on legal scenarios. If
> for example we compile with any version of nettle 3.1 or later (3.1 
> doesn't have version.h),

I'm not sure how hard it would be to migrate to building with -Wundef (I
haven't yet tried it in Nettle or any of my own projects). But it's of
course still possible check if a preprocessor symbol is defined, one
just has to use #ifdef FOO or #if defined(FOO) where appropriate.

I think it's very rare that the implicit expansion of undefined symbols
to 0 (in the context of the preprocessor evaluating the value of an
#if) really is important or desired.

A potential problem is the conventions around autoconf AC_DEFINE, where
symbols are usually either undefined or defined with the value 1. So
with -Wundef, I think one would need to use

  #ifdef HAVE_FOO 

rahter than 

  #if HAVE_FOO

(unless there's some recent features to change config.h convention, to
always define the symbols, to 0 or 1 depending on corresponding test).

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to