I built master on netbsd-6 i386 with

  gcc version 4.5.3 (NetBSD nb2 20110806) 

and

  clang version 3.6.2 (tags/RELEASE_362/final)

to see what I got for warnings.   It built and passed make check with
both.   Warnings from the make check stage are only in test-stream.c,
and it seems the same things are being warned about by both compilers.

GCC:

  CC       test-stream.o
test-stream.c:27:1: warning: overflow in implicit constant conversion
test-stream.c: In function ‘print_stream’:
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 2 has type ‘size_t’
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 3 has type ‘size_t’
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 4 has type ‘size_t’
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 2 has type ‘size_t’
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 3 has type ‘size_t’
test-stream.c:38:11: warning: format ‘%ld’ expects type ‘long int’, but 
argument 4 has type ‘size_t’
test-stream.c: In function ‘main’:
test-stream.c:73:3: warning: format ‘%lx’ expects type ‘long unsigned int’, but 
argument 2 has type ‘__uint64_t’
test-stream.c:73:3: warning: format ‘%lx’ expects type ‘long unsigned int’, but 
argument 2 has type ‘__uint64_t’

CLANG:

  CC       test-stream.o
test-stream.c:27:23: warning: implicit conversion from 'unsigned long long' to 
'long' changes value from 16045690984833335023 to -559038737 
[-Wconstant-conversion]
static long int ham = 0xdeadbeefdeadbeef;
                ~~~   ^~~~~~~~~~~~~~~~~~
test-stream.c:36:11: warning: format specifies type 'long' but the argument has 
type 'size_t' (aka 'unsigned int') [-Wformat]
          stream_get_endp (s),
          ^~~~~~~~~~~~~~~~~~~
test-stream.c:37:11: warning: format specifies type 'long' but the argument has 
type 'unsigned int' [-Wformat]
          STREAM_READABLE (s),
          ^~~~~~~~~~~~~~~~~~~
../lib/stream.h:123:28: note: expanded from macro 'STREAM_READABLE'
#define STREAM_READABLE(S) ((S)->endp - (S)->getp)
                           ^~~~~~~~~~~~~~~~~~~~~~~
test-stream.c:38:11: warning: format specifies type 'long' but the argument has 
type 'unsigned int' [-Wformat]
          STREAM_WRITEABLE (s));
          ^~~~~~~~~~~~~~~~~~~~
../lib/stream.h:121:29: note: expanded from macro 'STREAM_WRITEABLE'
#define STREAM_WRITEABLE(S) ((S)->size - (S)->endp)
                            ^~~~~~~~~~~~~~~~~~~~~~~
test-stream.c:73:25: warning: format specifies type 'unsigned long' but the 
argument has type '__uint64_t' (aka 'unsigned long long') [-Wformat]
  printf ("q: 0x%lx\n", stream_getq (s));
                ~~~     ^~~~~~~~~~~~~~~
                %llx
5 warnings generated.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to