tdb: fix warnings with gcc -O3, and one test crash.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 00:17:39 +0000 (10:47 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 00:17:39 +0000 (10:47 +1030)
commitb10598ebdad2302c637c14961525c0d9cef937f5
tree30c6f86df80726bde2c28f05a702f67bd7124d23
parente8dfb48ec9dd9a7575b179e8208cd2dd5c73bcce
tdb: fix warnings with gcc -O3, and one test crash.

unsigned char * is allowed to alias, so we use that for byte reversing
rather than uint32_t.  This is portable.

Remove warnings about ignoring pread/pwrite return values.

And initialize tdb before setjmp: with optimization, gcc validly saw this
as NULL and crashed.
ccan/tdb/io.c
ccan/tdb/test/run-corrupt.c
ccan/tdb/test/run-die-during-transaction.c