farsightsec / wdns

low-level DNS library
Apache License 2.0
18 stars 5 forks source link

t/: Fix format specifiers for size_t #15

Closed edmonds closed 8 years ago

edmonds commented 8 years ago

Use "%zd" to format size_t, not "%" PRIu64. Otherwise clang generates the following diagnostics:

  CC       t/test-str_to_name.o
../t/test-str_to_name.c:132:66: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                fprintf(stderr, NAME ": FAIL: %s (%" PRIu64 " failures)\n", s, ret);
                                                  ~~~                          ^~~
1 warning generated.
  CCLD     t/test-str_to_name
  CC       t/test-str_to_rcode.o
../t/test-str_to_rcode.c:61:66: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                fprintf(stderr, NAME ": FAIL: %s (%" PRIu64 " failures)\n", s, ret);
                                                  ~~~                          ^~~
1 warning generated.
  CCLD     t/test-str_to_rcode
  CC       t/test-str_to_rdata.o
../t/test-str_to_rdata.c:364:80: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                fprintf(stderr, NAME ": FAIL: %s (%" PRIu64 " failures)\n", s, ret);
                                                  ~~~                          ^~~
1 warning generated.
  CCLD     t/test-str_to_rdata
  CC       t/test-rdata_to_str.o
../t/test-rdata_to_str.c:265:80: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                fprintf(stderr, NAME ": FAIL: %s (%" PRIu64 " failures)\n", s, ret);
                                                  ~~~                          ^~~
1 warning generated.
  CCLD     t/test-rdata_to_str
  CC       t/test-str_to_rrtype.o
../t/test-str_to_rrtype.c:127:80: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                fprintf(stderr, NAME ": FAIL: %s (%" PRIu64 " failures)\n", s, ret);
                                                  ~~~                          ^~~
1 warning generated.
edmonds commented 8 years ago

Actually, that's not necessarily clang specific, but rather clang on OS X specific.