google / google/honggfuzz

Build errors on 32-bit architectures [-Werror=format=]

Open
#501 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.4k
Forks
539
PR merge metrics
No merged PRs in 30d

Description

For 2.6 there are build errors on x86 (i586) and arm32 (armv7hf):

```
fuzz.c:258:30: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
fuzz.c:258:35: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
fuzz.c:258:17: error: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
fuzz.c:258:17: error: format '%llu' expects argument of type 'long long unsigned int', but argument 8 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
fuzz.c:258:17: error: format '%llu' expects argument of type 'long long unsigned int', but argument 9 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
input.c:663:15: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'size_t' {aka 'unsigned in '} [-Werror=format=]
```

Perhaps `%zu` should be used? Or you should not have used `size_t` for counters in the first place, as `size_t` is intended for [maximum object (array) sizes](https://en.cppreference.com/w/c/types/size_t) (i.e. maximum sizeof value), and obviously this on 32-platforms is 32-bit number.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.