Opened 10 years ago

Closed 10 years ago

#2880 closed defect (fixed)

cu_varint warnings and lwout_twkb.c warnings

Reported by: robe Owned by: nicklas
Priority: medium Milestone: PostGIS 2.2.0
Component: postgis Version: master
Keywords: Cc: nicklas

Description (last modified by strk)

cu_varint.c
cu_varint.c: In function 'do_test_u32_varint':
cu_varint.c:30:2: warning: implicit declaration of function 'varint_u32_encoded_size' [-Wimplicit-function-declaration]
  size = varint_u32_encoded_size(nr);
  ^ 
cu_varint.c:35:2: warning: implicit declaration of function 'varint_u32_encode_buf' [-Wimplicit-function-declaration]
  varint_u32_encode_buf(nr, buf);
  ^
cu_varint.c: In function 'do_test_s32_varint':
cu_varint.c:50:2: warning: implicit declaration of function 'varint_s32_encoded_size' [-Wimplicit-function-declaration]
  size = varint_s32_encoded_size(nr);
  ^
cu_varint.c:55:2: warning: implicit declaration of function 'varint_s32_encode_buf' [-Wimplicit-function-declaration]
  varint_s32_encode_buf(nr, buf);
  ^
cu_varint.c: In function 'do_test_u64_varint':
cu_varint.c:70:2: warning: implicit declaration of function 'varint_u64_encoded_size' [-Wimplicit-function-declaration]
  size = varint_u64_encoded_size(nr);
  ^
cu_varint.c:75:2: warning: implicit declaration of function 'varint_u64_encode_buf' [-Wimplicit-function-declaration]
  varint_u64_encode_buf(nr, buf);
  ^
cu_varint.c: In function 'do_test_s64_varint':
cu_varint.c:90:2: warning: implicit declaration of function 'varint_s64_encoded_size' [-Wimplicit-function-declaration]
  size = varint_s64_encoded_size(nr);
  ^
cu_varint.c:95:2: warning: implicit declaration of function 'varint_s64_encode_buf' [-Wimplicit-function-declaration]
  varint_s64_encode_buf(nr, buf);
  ^
cu_varint.c: In function 'test_varint':
cu_varint.c:154:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
  do_test_s32_varint(-2147483648, 5, "FFFFFFFF0F");
  ^

Change History (7)

comment:1 by robe, 10 years ago

before the change r12871 I made to get rid of varint.h

used to give these warnings:

In file included from cu_varint.c:23:0:
../varint.h:62:1: warning: no previous prototype for 'varint_u32_encoded_size' [-Wmissing-prototypes]
 varint_u32_encoded_size(uint32_t val)
 ^
../varint.h:75:1: warning: no previous prototype for 'varint_u32_encode_buf' [-Wmissing-prototypes]
 varint_u32_encode_buf(uint32_t val, uint8_t *buf)
 ^
../varint.h:82:1: warning: no previous prototype for 'varint_s32_encoded_size' [-Wmissing-prototypes]
 varint_s32_encoded_size(int32_t val)
 ^
../varint.h:96:1: warning: no previous prototype for 'varint_s32_encode_buf' [-Wmissing-prototypes]
 varint_s32_encode_buf(int32_t val, uint8_t *buf)
 ^
../varint.h:104:1: warning: no previous prototype for 'varint_s64_encoded_size' [-Wmissing-prototypes]
 varint_s64_encoded_size(int64_t val)
 ^
../varint.h:118:1: warning: no previous prototype for 'varint_s64_encode_buf' [-Wmissing-prototypes]
 varint_s64_encode_buf(int64_t val, uint8_t *buf)
 ^
../varint.h:127:1: warning: no previous prototype for 'varint_u64_encoded_size' [-Wmissing-prototypes]
 varint_u64_encoded_size(uint64_t val)
 ^
../varint.h:140:1: warning: no previous prototype for 'varint_u64_encode_buf' [-Wmissing-prototypes]
 varint_u64_encode_buf(uint64_t val, uint8_t *buf)
 ^
cu_varint.c: In function 'test_varint':
cu_varint.c:156:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
  do_test_s32_varint(-2147483648, 5, "FFFFFFFF0F");
  ^

comment:2 by robe, 10 years ago

Summary: cu_varint warningscu_varint warnings and lwout_twkb.c warnings
In file included from lwout_twkb.c:13:0:
varint.h:62:1: warning: no previous prototype for 'varint_u32_encoded_size' [-Wmissing-prototypes]
 varint_u32_encoded_size(uint32_t val)
 ^
varint.h:75:1: warning: no previous prototype for 'varint_u32_encode_buf' [-Wmissing-prototypes]
 varint_u32_encode_buf(uint32_t val, uint8_t *buf)
 ^
varint.h:82:1: warning: no previous prototype for 'varint_s32_encoded_size' [-Wmissing-prototypes]
 varint_s32_encoded_size(int32_t val)
 ^
varint.h:96:1: warning: no previous prototype for 'varint_s32_encode_buf' [-Wmissing-prototypes]
 varint_s32_encode_buf(int32_t val, uint8_t *buf)
 ^
varint.h:104:1: warning: no previous prototype for 'varint_s64_encoded_size' [-Wmissing-prototypes]
 varint_s64_encoded_size(int64_t val)
 ^
varint.h:118:1: warning: no previous prototype for 'varint_s64_encode_buf' [-Wmissing-prototypes]
 varint_s64_encode_buf(int64_t val, uint8_t *buf)
 ^
varint.h:127:1: warning: no previous prototype for 'varint_u64_encoded_size' [-Wmissing-prototypes]
 varint_u64_encoded_size(uint64_t val)
 ^
varint.h:140:1: warning: no previous prototype for 'varint_u64_encode_buf' [-Wmissing-prototypes]
 varint_u64_encode_buf(uint64_t val, uint8_t *buf)

comment:3 by strk, 10 years ago

Description: modified (diff)

Should be fixed by r12874

comment:4 by strk, 10 years ago

Cc: nicklas added

Not fixed, not completely. GCC still wants a declaration for some of them. Also, I noticed some functions are declared as "static", which doesn't make much sense for an header file.

I'd leave fixing these to Nicklas.

comment:5 by nicklas, 10 years ago

I have put declarations in varint.h in r12875 I also removed "inline" just because I don't know how it works and from what I saw in from some google searches it looked like I could make things worse when dealing with inlined functions without fully understanding them. strk, feel free to put them there again.

comment:6 by nicklas, 10 years ago

Now I think I have got this right in r12878

When testing varint we don't need any functionality outside the varint.h header. So the problem wasn't that the varint header was included but that the liblwgeom_common header was included because that header also pointed to varint.h.

Now Winnie I hope you will feel better :-)

comment:7 by robe, 10 years ago

Resolution: fixed
Status: newclosed

This one got fixed at r12883, however more warnings. I'll put in a separate ticket.

Note: See TracTickets for help on using tickets.