| Summary: | Printf format code and data type do not match in taskset | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | pdvb |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.33.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Fixed in git, thank you. |
The following code uses an (unsigned long) "%lx" format code, but passes an (unsigned long long) value to printf. The result is that on architectures which use 32-bit for (unsigned long) and 64-bit for (unsigned long long) the printf produces incorrect output. #define TASKSET_PRINTF_MASK "%lx" static unsigned long long from_mask(ul *mask, unsigned sz_in_bytes UNUSED_PARAM) { return *mask; } This was broken by commit ef0e76cc on 1/29/2017 The quick fix is to define the function as: static unsigned long from_mask()