bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreeBSD: Warnings about c-ctype macros used but marked unused


From: Bruno Haible
Subject: Re: FreeBSD: Warnings about c-ctype macros used but marked unused
Date: Wed, 28 Aug 2019 17:28:46 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-159-generic; KDE/5.18.0; x86_64; ; )

Hi Tim,

> FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on
> LLVM 6.0.0)

OK.

> The option -Wused-but-marked-unused is indirectly activated by
> -Weverything

-Weverything is not something we can support in gnulib. For the
meaning of this option, see
https://quuxplusone.github.io/blog/2018/12/06/dont-use-weverything/

> which is set during the ./configure run (kind of a
> manywarnings module)

Why do we have a 'manywarnings' module, not an 'allwarnings' module?
Look into the list of warnings that we don't add through 'manywarnings':
  build-aux/gcc-warning.spec
  build-aux/g++-warning.spec

> And I wonder why do the c_ macros are marked
> UNUSED at all (I assume that gnulib does it for some reason) ?

'c-ctype' uses the module 'extern-inline'. In extern-inline.m4 you can
see that on platforms where 'extern inline' cannot properly be supported,
we let _GL_INLINE expand to 'static _GL_UNUSED'. Without '_GL_UNUSED',
gcc (with some appropriate, useful warning options) would complain that
the functions are not used.

The ability to use this warning option - which allows developers to
detect dead code - is more important than the option -Wused-but-marked-unused.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]