mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:33:34 +03:00
units: drop redundant pointer check and workaround
All users of the `verify_memory()` macro used a fixed-length buffer for
the test output, which then needed a workaround to silence GCC
`-Waddress` warnings.
```
tests/unit/unit1615.c: In function 'test_unit1615':
tests/libtest/unitcheck.h:51:8: error: the address of 'output_buf' will always evaluate as 'true' [-Werror=address]
51 | if((dynamic) && memcmp(dynamic, check, len)) { \
| ^
tests/unit/unit1615.c:114:3: note: in expansion of macro 'verify_memory'
114 | verify_memory(output_buf, precomp_hash1, CURL_SHA512_256_DIGEST_LENGTH);
| ^~~~~~~~~~~~~
```
Drop redundant address check and the workarounds with it.
Closes #21833
This commit is contained in:
parent
c5000b786b
commit
4e98f6d225
7 changed files with 20 additions and 29 deletions
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
#define verify_memory(dynamic, check, len) \
|
||||
do { \
|
||||
if((dynamic) && memcmp(dynamic, check, len)) { \
|
||||
if(memcmp(dynamic, check, len)) { \
|
||||
curl_mfprintf(stderr, "%s:%d Memory buffer FAILED match size %d. " \
|
||||
"'%s' is not\n", __FILE__, __LINE__, len, \
|
||||
hexdump((const unsigned char *)(check), len)); \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue