Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7eb86bd
autotools: Rename `build-aux` to `autotools-aux`
hebasto Nov 20, 2025
748c0fd
Add CMake build directory patterns to `.gitignore`
hebasto Nov 20, 2025
bb1d199
ecmult: Use size_t for array indices into tables
real-or-random Jan 7, 2026
47eb709
ecmult: Use size_t for array indices in _odd_multiplies_table
real-or-random Jan 7, 2026
4ac6511
cmake, refactor: Deduplicate test-related code
hebasto Jan 13, 2026
f95b263
cmake: Add DiscoverTests module
hebasto Jan 13, 2026
29f26ec
cmake: Integrate DiscoverTests and normalize test names
hebasto Jan 20, 2026
8354618
cmake: Set `LABELS` property for tests
hebasto Jan 13, 2026
1bc74a2
test: show both Autotools and CMake usage for ctime_tests
8144225309 Jan 22, 2026
14e5697
Merge bitcoin-core/secp256k1#1794: ecmult: Use size_t for array indices
real-or-random Jan 27, 2026
1605b02
Merge bitcoin-core/secp256k1#1775: Add CMake build directory patterns…
real-or-random Jan 28, 2026
0267b65
release process: mention the `[Unreleased]` link clearly
jonasnick Jan 30, 2026
0ffb174
ci, docker: Fix LLVM repository signature failure
hebasto Feb 1, 2026
2f18567
ci: Rotate Docker cache keys every 4 weeks
hebasto Feb 2, 2026
2ccff6e
ci: Add weekly schedule
hebasto Feb 2, 2026
cd49c57
Merge bitcoin-core/secp256k1#1814: release process: mention the `[Unr…
real-or-random Feb 2, 2026
453949a
Merge bitcoin-core/secp256k1#1816: ci: Rotate Docker cache keys
real-or-random Feb 2, 2026
13e3bee
refactor: Remove trailing whitespace
hebasto Jan 28, 2026
fb229e7
build: Add `-Wtrailing-whitespace=any` compiler flag
hebasto Jan 29, 2026
86cae58
build: Add `-Wleading-whitespace=spaces` compiler flag
hebasto Jan 29, 2026
57315a6
Merge bitcoin-core/secp256k1#1813: Remove trailing spaces and introdu…
real-or-random Feb 2, 2026
97b3c47
refactor: remove unnecessary `malloc` result casts
theStack Jan 30, 2026
3ae72e7
ci: Disable Docker build summary generation
hebasto Feb 3, 2026
4fb7ccf
ci: Enforce base-10 evaluation
hebasto Feb 3, 2026
97de512
Merge bitcoin-core/secp256k1#1804: test: show both CMake and Autotool…
real-or-random Feb 3, 2026
c5da3bd
Merge bitcoin-core/secp256k1#1818: ci: Enforce base-10 evaluation
real-or-random Feb 3, 2026
99ab4a1
Merge bitcoin-core/secp256k1#1817: ci: Disable Docker build summary g…
real-or-random Feb 3, 2026
d071aa5
Merge bitcoin-core/secp256k1#1815: refactor: remove unnecessary `mall…
real-or-random Feb 4, 2026
f47bbc0
test: add unit tests for secp256k1_scalar_check_overflow
therohityadav Feb 4, 2026
1d146ac
Merge bitcoin-core/secp256k1#1819: tests: Improve secp256k1_scalar_ch…
real-or-random Feb 4, 2026
c49c9be
bench: Update help functions in bench and bench_internal
kevkevinpal Jan 23, 2026
ed02466
ci: Load Docker image by ID from builder step
hebasto Feb 13, 2026
322d0a4
Merge bitcoin-core/secp256k1#1823: ci: Load Docker image by ID from b…
real-or-random Feb 16, 2026
307b49f
ellswift: fix overflow flag handling in secp256k1_ellswift_xdh
Feb 11, 2026
b99a94c
Add tests for bad scalar inputs in ellswift XDH
Feb 12, 2026
c7a7f73
Merge bitcoin-core/secp256k1#1821: ellswift: fix overflow flag handli…
real-or-random Feb 17, 2026
ac56160
Merge bitcoin-core/secp256k1#1760: cmake: Add dynamic test discovery …
real-or-random Feb 19, 2026
76e92cf
Revert "ci, docker: Fix LLVM repository signature failure"
hebasto Feb 20, 2026
dfe042f
Merge bitcoin-core/secp256k1#1828: Revert "ci, docker: Fix LLVM repos…
real-or-random Feb 23, 2026
79e9f25
ci: Fix leftover use of old ECMULTGENPRECISION
real-or-random Feb 25, 2026
3019186
Merge bitcoin-core/secp256k1#1829: ci: Fix leftover use of old ECMULT…
real-or-random Feb 25, 2026
f48b1bf
hash: add midstate initializer and use it for tagged hashes
w0xlt Feb 18, 2026
95e6815
Merge bitcoin-core/secp256k1#1825: hash: remove redundant `secp256k1_…
real-or-random Feb 27, 2026
8d0eda0
testrand: Remove testrand_finish
real-or-random Mar 2, 2026
10f546a
Merge bitcoin-core/secp256k1#1832: testrand: Remove testrand_finish
real-or-random Mar 2, 2026
c0a2aba
Merge bitcoin-core/secp256k1#1811: bench: Update help functions in be…
real-or-random Mar 3, 2026
3b2ceb3
Merge commits '14e56970 1605b02f cd49c57e 453949ab 57315a69 97de5120 …
mllwchrry Mar 3, 2026
126501f
modules: Port bitcoin-core/secp256k1#1815 to zkp-specific code
mllwchrry Mar 3, 2026
48cbd78
modules: Port bitcoin-core/secp256k1#1825 to zkp-specific code
mllwchrry Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/actions/run-in-docker-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ inputs:
required: true
scope:
description: 'A cached image scope'
required: false
default: ${{ runner.arch }}
required: true
command:
description: 'A command to run in a container'
required: true
Expand Down Expand Up @@ -45,7 +44,7 @@ runs:
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \
--volume ${{ github.workspace }}:${{ github.workspace }} \
--workdir ${{ github.workspace }} \
$(docker images -q | head -n1) \
${{ case(steps.main_builder.outcome == 'success', steps.main_builder.outputs.imageid, steps.retry_builder.outputs.imageid) }} \
bash -c "
git config --global --add safe.directory ${{ github.workspace }}
${{ inputs.command }}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- '**'
tags-ignore:
- '**'
schedule:
# Run on the default branch every Monday morning.
# This also warms the Docker caches after key rotation.
- cron: '22 2 * * 1'

concurrency:
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
Expand Down Expand Up @@ -50,11 +54,16 @@ env:
SYMBOL_CHECK: 'yes'
# Compile and run the examples.
EXAMPLES: 'yes'
# Disable Docker build summary generation.
# See https://github.com/docker/build-push-action/blob/master/README.md#environment-variables.
DOCKER_BUILD_SUMMARY: false

jobs:
docker_cache:
name: "Build ${{ matrix.arch }} Docker image"
runs-on: ${{ matrix.runner }}
outputs:
cache_scope: ${{ steps.cache_timestamp.outputs.period }}

strategy:
fail-fast: false
Expand All @@ -66,6 +75,10 @@ jobs:
runner: ubuntu-24.04-arm

steps:
- name: Get cache validity period
id: cache_timestamp
run: echo "period=$((10#$(date +%V) / 4))" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand All @@ -77,8 +90,8 @@ jobs:
uses: docker/build-push-action@v6
with:
file: ./ci/linux-debian.Dockerfile
cache-from: type=gha,scope=${{ runner.arch }}
cache-to: type=gha,scope=${{ runner.arch }},mode=min
cache-from: type=gha,scope=${{ runner.arch }}-${{ steps.cache_timestamp.outputs.period }}
cache-to: type=gha,scope=${{ runner.arch }}-${{ steps.cache_timestamp.outputs.period }},mode=min

x86_64-debian:
name: "x86_64: Linux (Debian stable)"
Expand Down Expand Up @@ -124,6 +137,7 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
scope: ${{ runner.arch }}-${{ needs.docker_cache.outputs.cache_scope }}
command: ./ci/ci.sh

- &PRINT_LOGS
Expand Down Expand Up @@ -723,6 +737,7 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
scope: ${{ runner.arch }}-${{ needs.docker_cache.outputs.cache_scope }}
command: |
g++ -Werror include/*.h
clang -Werror -x c++-header include/*.h
Expand Down
21 changes: 5 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,16 @@ coverage.*.html
*.gcno
*.gcov

build-aux/ar-lib
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
/autotools-aux/
!/autotools-aux/m4/bitcoin_secp.m4

libsecp256k1.pc
contrib/gh-pr-create.sh

### CMake
/CMakeUserPresets.json
# Default CMake build directory.
/build
# CMake build directories.
/*build*

### Python
__pycache__/
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,15 @@ else()
try_append_c_flags(-Wcast-align=strict) # GCC >= 8.0.
try_append_c_flags(-Wconditional-uninitialized) # Clang >= 3.0 only.
try_append_c_flags(-Wextra) # GCC >= 3.4, this is the newer name of -W, which we don't use because older GCCs will warn about unused functions.
try_append_c_flags(-Wleading-whitespace=spaces) # GCC >= 15.0
try_append_c_flags(-Wnested-externs)
try_append_c_flags(-Wno-long-long) # GCC >= 3.0, -Wlong-long is implied by -pedantic.
try_append_c_flags(-Wno-overlength-strings) # GCC >= 4.2, -Woverlength-strings is implied by -pedantic.
try_append_c_flags(-Wno-unused-function) # GCC >= 3.0, -Wunused-function is implied by -Wall.
try_append_c_flags(-Wreserved-identifier) # Clang >= 13.0 only.
try_append_c_flags(-Wshadow)
try_append_c_flags(-Wstrict-prototypes)
try_append_c_flags(-Wtrailing-whitespace=any) # GCC >= 15.0
try_append_c_flags(-Wundef)
endif()

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ACLOCAL_AMFLAGS = -I build-aux/m4
ACLOCAL_AMFLAGS = -I autotools-aux/m4

# AM_CFLAGS will be automatically prepended to CFLAGS by Automake when compiling some foo
# which does not have an explicit foo_CFLAGS variable set.
Expand Down
File renamed without changes.
71 changes: 71 additions & 0 deletions cmake/DiscoverTests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# TODO: rework/remove once test discovery is implemented upstream:
# https://gitlab.kitware.com/cmake/cmake/-/issues/26920
function(discover_tests target)
set(options "")
set(oneValueArgs DISCOVERY_MATCH TEST_NAME_REPLACEMENT TEST_ARGS_REPLACEMENT)
set(multiValueArgs DISCOVERY_ARGS PROPERTIES)
cmake_parse_arguments(PARSE_ARGV 1 arg "${options}" "${oneValueArgs}" "${multiValueArgs}")

set(file_base ${CMAKE_CURRENT_BINARY_DIR}/${target})
set(include_file ${file_base}_include.cmake)

set(properties_content)
list(LENGTH arg_PROPERTIES properties_len)
if(properties_len GREATER "0")
set(properties_content " set_tests_properties(\"\${test_name}\" PROPERTIES\n")
math(EXPR num_properties "${properties_len} / 2")
foreach(i RANGE 0 ${num_properties} 2)
math(EXPR value_index "${i} + 1")
list(GET arg_PROPERTIES ${i} name)
list(GET arg_PROPERTIES ${value_index} value)
string(APPEND properties_content " \"${name}\" \"${value}\"\n")
endforeach()
string(APPEND properties_content " )\n")
endif()

string(CONCAT include_content
"set(runner [[$<TARGET_FILE:${target}>]])\n"
"set(launcher [[$<TARGET_PROPERTY:${target},TEST_LAUNCHER>]])\n"
"set(emulator [[$<$<BOOL:${CMAKE_CROSSCOMPILING}>:$<TARGET_PROPERTY:${target},CROSSCOMPILING_EMULATOR>>]])\n"
"\n"
"execute_process(\n"
" COMMAND \${launcher} \${emulator} \${runner} ${arg_DISCOVERY_ARGS}\n"
" OUTPUT_VARIABLE output OUTPUT_STRIP_TRAILING_WHITESPACE\n"
" ERROR_VARIABLE output ERROR_STRIP_TRAILING_WHITESPACE\n"
" RESULT_VARIABLE result\n"
")\n"
"\n"
"if(NOT result EQUAL 0)\n"
" add_test([[${target}_DISCOVERY_FAILURE]] \${launcher} \${emulator} \${runner} ${arg_DISCOVERY_ARGS})\n"
"else()\n"
" string(REPLACE \"\\n\" \";\" lines \"\${output}\")\n"
" foreach(line IN LISTS lines)\n"
" if(line MATCHES \"${arg_DISCOVERY_MATCH}\")\n"
" string(REGEX REPLACE \"${arg_DISCOVERY_MATCH}\" \"${arg_TEST_NAME_REPLACEMENT}\" test_name \"\${line}\")\n"
" string(REGEX REPLACE \"${arg_DISCOVERY_MATCH}\" \"${arg_TEST_ARGS_REPLACEMENT}\" test_args \"\${line}\")\n"
" separate_arguments(test_args)\n"
" add_test(\"\${test_name}\" \${launcher} \${emulator} \${runner} \${test_args})\n"
${properties_content}
" endif()\n"
" endforeach()\n"
"endif()\n"
)

get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
file(GENERATE
OUTPUT ${file_base}_include-$<CONFIG>.cmake
CONTENT "${include_content}"
)
file(WRITE ${include_file}
"include(\"${file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")"
)
else()
file(GENERATE
OUTPUT ${include_file}
CONTENT "${include_content}"
)
endif()

set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES ${include_file})
endfunction()
6 changes: 4 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ define(_LIB_VERSION_AGE, 0)

AC_INIT([libsecp256k1],m4_join([.], _PKG_VERSION_MAJOR, _PKG_VERSION_MINOR, _PKG_VERSION_PATCH)m4_if(_PKG_VERSION_IS_RELEASE, [true], [], [-dev]),[https://github.com/bitcoin-core/secp256k1/issues],[libsecp256k1],[https://github.com/bitcoin-core/secp256k1])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AC_CONFIG_AUX_DIR([autotools-aux])
AC_CONFIG_MACRO_DIR([autotools-aux/m4])
AC_CANONICAL_HOST

# Require Automake 1.11.2 for AM_PROG_AR
Expand Down Expand Up @@ -111,6 +111,8 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
SECP_TRY_APPEND_CFLAGS([-Wcast-align=strict], $1) # GCC >= 8.0
SECP_TRY_APPEND_CFLAGS([-Wconditional-uninitialized], $1) # Clang >= 3.0 only
SECP_TRY_APPEND_CFLAGS([-Wreserved-identifier], $1) # Clang >= 13.0 only
SECP_TRY_APPEND_CFLAGS([-Wtrailing-whitespace=any], $1) # GCC >= 15.0
SECP_TRY_APPEND_CFLAGS([-Wleading-whitespace=spaces], $1) # GCC >= 15.0

CFLAGS="$SECP_TRY_APPEND_DEFAULT_CFLAGS_saved_CFLAGS"
fi
Expand Down
2 changes: 1 addition & 1 deletion doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Perform these checks when reviewing the release PR (see below):
4. Open a PR to the master branch with a commit (using message `"release cleanup: bump version after $MAJOR.$MINOR.$PATCH"`, for example) that
* sets `_PKG_VERSION_IS_RELEASE` to `false` and increments `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac`,
* increments the `$PATCH` component of `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_REVISION` in `CMakeLists.txt`, and
* adds an `[Unreleased]` section header to the [CHANGELOG.md](../CHANGELOG.md).
* adds an `[Unreleased]` section header and a corresponding `[Unreleased]` link at the bottom of [CHANGELOG.md](../CHANGELOG.md).

If other maintainers are not present to approve the PR, it can be merged without ACKs.
5. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
Expand Down
6 changes: 4 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ function(add_example name)
secp256k1
$<$<PLATFORM_ID:Windows>:bcrypt>
)
set(test_name ${name}_example)
add_test(NAME secp256k1_${test_name} COMMAND ${target_name})
add_test(NAME secp256k1.example.${name} COMMAND ${target_name})
set_tests_properties(secp256k1.example.${name} PROPERTIES
LABELS secp256k1_example
)
endfunction()

add_example(ecdsa)
Expand Down
2 changes: 1 addition & 1 deletion include/secp256k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ SECP256K1_API void secp256k1_context_destroy(
* writes the message to stderr and calls abort. This default callback can be
* replaced at link time if the preprocessor macro
* USE_EXTERNAL_DEFAULT_CALLBACKS is defined, which is the case if the build
* has been configured with --enable-external-default-callbacks (GNU Autotools) or
* has been configured with --enable-external-default-callbacks (GNU Autotools) or
* -DSECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS=ON (CMake). Then the
* following two symbols must be provided to link against:
* - void secp256k1_default_illegal_callback_fn(const char *message, void *data);
Expand Down
32 changes: 22 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ set_target_properties(secp256k1_objs PROPERTIES
)

# This emulates Libtool to make sure Libtool and CMake agree on the ABI version,
# see below "Calculate the version variables" in build-aux/ltmain.sh.
# see below "Calculate the version variables" in autotools-aux/ltmain.sh.
math(EXPR ${PROJECT_NAME}_soversion "${${PROJECT_NAME}_LIB_VERSION_CURRENT} - ${${PROJECT_NAME}_LIB_VERSION_AGE}")
set_target_properties(secp256k1 PROPERTIES
SOVERSION ${${PROJECT_NAME}_soversion}
Expand Down Expand Up @@ -196,15 +196,24 @@ if(SECP256K1_BUILD_TESTS)
list(APPEND TEST_DEFINITIONS SUPPORTS_CONCURRENCY=1)
endif()

add_executable(noverify_tests tests.c)
target_link_libraries(noverify_tests secp256k1_precomputed secp256k1_asm)
target_compile_definitions(noverify_tests PRIVATE ${TEST_DEFINITIONS})
add_test(NAME secp256k1_noverify_tests COMMAND noverify_tests)
function(add_executable_and_tests exe_name verify_definition)
add_executable(${exe_name} tests.c)
target_link_libraries(${exe_name} secp256k1_precomputed secp256k1_asm)
target_compile_definitions(${exe_name} PRIVATE ${verify_definition} ${TEST_DEFINITIONS})
include(DiscoverTests)
discover_tests(${exe_name}
DISCOVERY_ARGS "--list_tests"
DISCOVERY_MATCH "^\\t\\\\[ *[0-9]+\\\\] ([^ ].*)$"
TEST_NAME_REPLACEMENT "secp256k1.${exe_name}.\\\\1"
TEST_ARGS_REPLACEMENT "--target=\\\\1 --log=1"
PROPERTIES
LABELS "secp256k1_${exe_name}"
)
endfunction()

add_executable_and_tests(noverify_tests "")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Coverage")
add_executable(tests tests.c)
target_compile_definitions(tests PRIVATE VERIFY ${TEST_DEFINITIONS})
target_link_libraries(tests secp256k1_precomputed secp256k1_asm)
add_test(NAME secp256k1_tests COMMAND tests)
add_executable_and_tests(tests VERIFY)
endif()
unset(TEST_DEFINITIONS)
endif()
Expand All @@ -214,7 +223,10 @@ if(SECP256K1_BUILD_EXHAUSTIVE_TESTS)
add_executable(exhaustive_tests tests_exhaustive.c)
target_link_libraries(exhaustive_tests secp256k1_asm)
target_compile_definitions(exhaustive_tests PRIVATE $<$<NOT:$<CONFIG:Coverage>>:VERIFY>)
add_test(NAME secp256k1_exhaustive_tests COMMAND exhaustive_tests)
add_test(NAME secp256k1.exhaustive_tests COMMAND exhaustive_tests)
set_tests_properties(secp256k1.exhaustive_tests PROPERTIES
LABELS secp256k1_exhaustive
)
endif()

if(SECP256K1_BUILD_CTIME_TESTS)
Expand Down
10 changes: 5 additions & 5 deletions src/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "util.h"
#include "bench.h"

static void help(int default_iters) {
static void help(const char *executable_path, int default_iters) {
printf("Benchmarks the following algorithms:\n");
printf(" - ECDSA signing/verification\n");

Expand All @@ -36,7 +36,7 @@ static void help(int default_iters) {
printf("The default number of iterations for each benchmark is %d. This can be\n", default_iters);
printf("customized using the SECP256K1_BENCH_ITERS environment variable.\n");
printf("\n");
printf("Usage: ./bench [args]\n");
printf("Usage: %s [args]\n", executable_path);
printf("By default, all benchmarks will be run.\n");
printf("args:\n");
printf(" help : display this help and exit\n");
Expand Down Expand Up @@ -189,19 +189,19 @@ int main(int argc, char** argv) {
int default_iters = 20000;
int iters = get_iters(default_iters);
if (iters == 0) {
help(default_iters);
help(argv[0], default_iters);
return EXIT_FAILURE;
}

if (argc > 1) {
if (have_flag(argc, argv, "-h")
|| have_flag(argc, argv, "--help")
|| have_flag(argc, argv, "help")) {
help(default_iters);
help(argv[0], default_iters);
return EXIT_SUCCESS;
} else if (invalid_args) {
fprintf(stderr, "./bench: unrecognized argument.\n\n");
help(default_iters);
help(argv[0], default_iters);
return EXIT_FAILURE;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void print_number(const int64_t x) {
y /= 10;
}
} else if (c == 0) { /* fractional part is 0 */
buffer[--ptr] = '0';
buffer[--ptr] = '0';
}
buffer[--ptr] = '.';
do {
Expand Down
Loading
Loading