Project

General

Profile

Actions

Bug #4284

open

FreeBSD Clang reports warning, libnvpair

Added by sean bruno almost 10 years ago. Updated over 9 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
lib - userland libraries
Start date:
2013-11-04
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

Minor warning nit from clang:

/home/sbruno/bsd/fbsd_head/cddl/lib/libnvpair/../../../cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:213:44: warning: length modifier 'll' results in undefined behavior or no effect with 'f' conversion specifier [-Wformat]
NVLIST_PRTFUNC(double, double, double, "0x%llf")
                                          ~^~~
/home/sbruno/bsd/fbsd_head/cddl/lib/libnvpair/../../../cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:198:21: note: expanded from macro 'NVLIST_PRTFUNC'
        (void) fprintf(fp, vfmt, (ptype)value); \\\\

Patch tested on i386 and amd64 FreeBSD:

$ svn diff cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c
Index: cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c
===================================================================
--- cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c    (revision 257637)
+++ cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c    (working copy)
@@ -210,7 +210,7 @@
 NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x")
 NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld")
 NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx")
-NVLIST_PRTFUNC(double, double, double, "0x%llf")
+NVLIST_PRTFUNC(double, double, double, "0x%f")
 NVLIST_PRTFUNC(string, char *, char *, "%s")
 NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx")

No data to display

Actions

Also available in: Atom PDF