HomePhabricator

[secp256k1] misc autotools improvements

Description

[secp256k1] misc autotools improvements

Summary:

Drop no longer used Autoheader macros

Do not link bench and ctime_tests to COMMON_LIB

The bench and ctime_tests are users of the library, they should only
be linked to the library, not the objects it was built from.

build: Add -Wreserved-identifier supported by clang

This warns on certain identifiers reserved by the C standard, namely

  • identifiers that begin with an underscore followed by an uppercase letter, and
  • identifiers in the global namespace that begin with an underscore.

We had used such identifiers in the past for macros in include guards,
and we should make sure that we don't reintroduce such identifiers
going forward.

Note that C reserves more identifiers for "future library directions",
e.g., identifiers that begin with "str" followed by a lowercase letter.
But even the C standards committee has decided that this is somewhat
silly and adopted a proposal [1] for C23 that removes the restriction
that programs using these identifiers have UB. Instead, these
identifiers are now "potentially reserved", which is not a normative
restriction but simply an informative warning that the identifiers
may become fully reserved in the future.

[1] https://www.open-std.org/jtc1/sc22/WG14/www/docs/n2625.pdf

Note the CMake build has this flag since D19483

This is a backport of secp256k1#1200, secp256k1#1203 and secp256k1#1206

Test Plan:

./autogen.sh
cd build
CC=clang ../configure
make
make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D19812

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Jan 28 2023, 07:26
PiRKCommitted on Apr 11 2026, 12:50
PiRKPushed on Apr 11 2026, 12:50
Reviewer
Restricted Project
Differential Revision
D19812: [secp256k1] misc autotools improvements
Parents
rABC8acc20dc06c6: [chronik] Improve error handling of the electrum interface
Branches
Unknown
Tags
Unknown