summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-03-17 13:38:55 -0700
committerBen Pfaff <blp@ovn.org>2017-03-17 13:39:01 -0700
commitfd13c6b549c5376745391390af663d8689e3ee6b (patch)
treebf9596ed7380c59c4cbab4a32b6b725ac182cfa8 /lib/bfd.c
parent59cf52e6d3307d5889335893fc941fe55cd3ed99 (diff)
downloadopenvswitch-fd13c6b549c5376745391390af663d8689e3ee6b.tar.gz
Fix format specifier technicalities.
Various printf() format specifiers in the tree had minor technical issues which the Mac OS build reported, e.g. here: https://s3.amazonaws.com/archive.travis-ci.org/jobs/208718342/log.txt These tend to fall into two categories of harmless warnings: 1. Wrong width for types that are all promoted to 'int'. For example, both uint8_t and uint16_t are both promoted to 'int' as part of a call to printf(), but using PRIu8 for a uint16_t causes a warning. 2. Wrong format specifier for type promoted to 'int' due to arithmetic. For example, if 'x' is a uint8_t, then x >> 1 has type 'int' due to C's promotion rules, so the correct format specifier is %d and using PRIu8 will cause a warning. This commit fixes the warnings. I didn't see anything that rose to the level of a bug. These warnings only showed up on Mac OS X because of differences in the format specifiers that Mac OS uses for PRI*. Reported-by: Shu Shen <shu.shen@gmail.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 87f3322ee..1fb1cfb2b 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014, 2015, 2016 Nicira, Inc.
+/* Copyright (c) 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1061,7 +1061,7 @@ log_msg(enum vlog_level level, const struct msg *p, const char *message,
ds_put_format(&ds,
"%s: %s."
- "\n\tvers:%"PRIu8" diag:\"%s\" state:%s mult:%"PRIu8
+ "\n\tvers:%d diag:\"%s\" state:%s mult:%"PRIu8
" length:%"PRIu8
"\n\tflags: %s"
"\n\tmy_disc:0x%"PRIx32" your_disc:0x%"PRIx32