| Summary: | occlusion-query.c:190:45: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Vinson Lee <vlee> |
| Component: | Other | Assignee: | Mark Janes <mark.a.janes> |
| Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
| Severity: | normal | ||
| Priority: | medium | CC: | mark.a.janes |
| Version: | unspecified | Keywords: | bisected, regression |
| Hardware: | x86-64 (AMD64) | ||
| OS: | All | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
Vinson: I don't know how to reproduce this build error, but I think this patch should fix it: https://gitlab.freedesktop.org/majanes/mesa/commit/c421d1533f86c5bcd18974164c4e8bf2457e7b96 Can you test the patch and let me know if there are any other printf security issues in your build configuration? Oops, I guess it needs an include also: https://gitlab.freedesktop.org/majanes/mesa/commit/97e056faf38ff65274dd91e2a1d29ae7859c1c51 (In reply to Mark Janes from comment #2) > Oops, I guess it needs an include also: > > > https://gitlab.freedesktop.org/majanes/mesa/commit/ > 97e056faf38ff65274dd91e2a1d29ae7859c1c51 Patch looks spot-on. Feel free to add my r-b when sending it for inclusion. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Fixed by: 04dac6975234d3b4e5da6aa61e6b787cb576f0e6 Author: Mark Janes <mark.a.janes@intel.com> tests/graw: use C99 print conversion specifier for 32 bit builds Fixes formatting errors for 32 bit compilations, eg: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] printf("result1 = %lu result2 = %lu\n", res1.u64, res2.u64); Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
../src/gallium/tests/graw/occlusion-query.c:190:45: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] printf("result1 = %lu result2 = %lu\n", res1.u64, res2.u64); ~~~ ^~~~~~~~ %llu commit c9c1e26106478258d8a91fe8fc5c69d8c3fa5206 Author: Mark Janes <mark.a.janes@intel.com> Date: Mon Jun 3 16:59:45 2019 -0700 mesa: prevent common string formatting security issues Adds a compile-time error for obvious security issues like: printf(string_var); The proposed flag is more tolerant than -Wformat-nonliteral. Specifically, it tolerates common mesa formatting like: static const char *shader_template = "really long string %d"; printf(shader_template, uniform_number); Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110833 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Engestrom <eric@engestrom.ch>