Skip to content

[Bug]: Compile-time error when defining GENERATE_MACHINE_PARSEABLE_REPORT #5814

Description

@gojimmypi

Contact Details

gojimmypi@gmail.com

Version

Latest master 5.3.3

Description

Adding #define GENERATE_MACHINE_PARSEABLE_REPORT at the beginning of a wolfSSL user_settings.h file causes a compile-time error in benchmark.c, as total_cycles appears to be undefined.

I've observed this in the Espressif ESP32 environment using the default user_settings.h

I have not yet tested on other platforms.

This was first observed using the code update in #5800 . The current master branch may fail to compile this Espressif example due to missing benchmark source files in the local directory.

Reproduction steps

# change to wolfssl clone
git checkout master

# install wolfssl as needed to ./component/ directory of ESP-IDF
./IDE/Espressif/ESP-IDF/setup.sh 

# enable ESP-IDF encironment, in this case VisualGDB using v4.4.2
. /mnt/c/SysGCC/esp32/esp-idf/v4.4.2/export.sh

# change to benchmark sample directory
cd ./IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark

# fresh benchmark files may need to be copied locally, PR 5800 also addresses this
cp ../../../../../wolfcrypt/benchmark/benchmark.c ./main/.
cp ../../../../../wolfcrypt/benchmark/benchmark.h ./main/.

# build the benchmark project
idf.py build  

observe error.

Relevant log output

/mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/wolfssl/wolfcrypt/benchmark/benchmark.c: In function 'bench_stats_sym_finish':
/mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/wolfssl/wolfcrypt/benchmark/benchmark.c:1716:57: error: 'total_cycles' undeclared (first use in this function)
                         bytes_processed, total, persec, total_cycles);
                                                         ^~~~~~~~~~~~
/mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/wolfssl/wolfcrypt/benchmark/benchmark.c:1716:57: note: each undeclared identifier is reported only once for each function it appears in
/mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/wolfssl/wolfcrypt/benchmark/benchmark.c: In function 'bench_stats_asym_finish_ex':
/mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/wolfssl/wolfcrypt/benchmark/benchmark.c:1804:39: error: 'total_cycles' undeclared (first use in this function)
                         count, total, total_cycles,
                                       ^~~~~~~~~~~~
[757/765] Building C object esp-idf/wolfssl/CMakeFiles/__idf_wolfssl.dir/wolfcrypt/test/test.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions