[PATCH 1/3] libtraceevent: Fix uninitialized has_0x compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Initialize has_0x in order to supress the following compiler warning:

  event-parse.c:5654:20: warning: 'has_0x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   5654 |                 if (has_0x)
        |                    ^
  event-parse.c:5619:14: note: 'has_0x' was declared here
   5619 |         bool has_0x;
        |              ^~~~~~

Signed-off-by: Michael Petlan <mpetlan@xxxxxxxxxx>
---
 src/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/event-parse.c b/src/event-parse.c
index 980e980..edf990a 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -5657,7 +5657,7 @@ static inline void print_field(struct trace_seq *s, void *data, int size,
 	struct tep_print_parse *start_parse;
 	struct tep_print_parse *parse;
 	struct tep_print_arg *arg;
-	bool has_0x;
+	bool has_0x = false;
 
 	parse = parse_ptr ? *parse_ptr : event->print_fmt.print_cache;
 
-- 
2.18.4




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux