perf print_insn: Include sys/types.h for ssize_t
PATCH 1/1 perf print_insn: Include sys/types.h for ssize_t
print_insn.h declares fprintf_insn_asm() with an ssize_t return type but does not include the header defining that type. This causes builds where stdio.h does not provide ssize_t to fail when compiling util/print_insn.c:
util/print_insn.h:21:1: error: unknown type name 'ssize_t'
Include sys/types.h so the header provides its own dependency for ssize_t.
--- tools/perf/util/print_insn.h | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/print_insn.h +1 -0
@@ -4,6 +4,7 @@#include <stddef.h> #include <stdio.h> +#include <sys/types.h> #include <linux/types.h>
Signature · 1 line
2.53.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 10 lines
print_insn.hdeclaresfprintf_insn_asm()with anssize_treturn type but does not include the header defining that type. This causes builds wherestdio.hdoes not providessize_tto fail when compilingutil/print_insn.c:
util/print_insn.h:21:1: error: unknown type name 'ssize_t'Include
sys/types.hso the header provides its own dependency forssize_t.Fixes 218c200f677d ("perf script: Consolidate capstone print functions")Signed-off-by Florian Fainelli <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 19 lines · Florian Fainelli
print_insn.hdeclaresfprintf_insn_asm()with anssize_treturn type but does not include the header defining that type. This causes builds wherestdio.hdoes not providessize_tto fail when compilingutil/print_insn.c:
util/print_insn.h:21:1: error: unknown type name 'ssize_t'Include
sys/types.hso the header provides its own dependency forssize_t.Fixes 218c200f677d ("perf script: Consolidate capstone print functions")Signed-off-by Florian Fainelli <[email protected]>--- tools/perf/util/print_insn.h | 1 + 1 file changed, 1 insertion(+)tools/perf/util/print_insn.h +0
-0
tools/perf/util/print_insn.h line 10
Quoted 7 lines
tools/perf/util/print_insn.h +1
-0@@ -4,6 +4,7 @@#include <stddef.h> #include <stdio.h> +#include <sys/types.h> #include <linux/types.h>
Quoted 9 lines · James Clark
tools/perf/util/print_insn.h line 7
Quoted 6 lines · Florian Fainelli
+++
b/tools/perf/util/print_insn.htools/perf/util/print_insn.h +1
-0@@ -4,6 +4,7 @@#include <stddef.h> #include <stdio.h> +#include <sys/types.h> #include <linux/types.h> Reviewed-by James Clark <[email protected]>
Thanks, applied for v7.4.
- Arnaldo