summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-12-03 06:46:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:42 -0500
commitc65b752604f8f58abc4e7ae8514dc2c7f086271c (patch)
treeda9522d6228c320c6934373dde6e214df3caf8b3 /source/lib
parent47a9f2c3d6039a07a6970ac181aeb2888d47a353 (diff)
downloadsamba-c65b752604f8f58abc4e7ae8514dc2c7f086271c.tar.gz
samba-c65b752604f8f58abc4e7ae8514dc2c7f086271c.tar.xz
samba-c65b752604f8f58abc4e7ae8514dc2c7f086271c.zip
r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6... Fix a bunch of C99 dereferencing type-punned pointer will break strict-aliasing rules errors. Also added prs_int32 (not uint32...) as it's needed in one place. Find places where prs_uint32 was being used to marshall/unmarshall a time_t (a big no no on 64-bits). More warning fixes to come. Thanks to Volker for nudging me to compile like this. Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/charcnv.c2
-rw-r--r--source/lib/clobber.c2
-rw-r--r--source/lib/crc32.c2
-rw-r--r--source/lib/util_file.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c
index 4fbad0f3d18..0c806167f41 100644
--- a/source/lib/charcnv.c
+++ b/source/lib/charcnv.c
@@ -781,7 +781,7 @@ size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
smb_ucs2_t *buffer = NULL;
size = convert_string_allocate(NULL, CH_UNIX, CH_UCS2, src, srclen,
- (void **) &buffer, True);
+ (void **)(void *)&buffer, True);
if (size == (size_t)-1 || !buffer) {
smb_panic("failed to create UCS2 buffer");
}
diff --git a/source/lib/clobber.c b/source/lib/clobber.c
index fb3a0dc2815..54b24ffed39 100644
--- a/source/lib/clobber.c
+++ b/source/lib/clobber.c
@@ -54,7 +54,7 @@ void clobber_region(const char *fn, unsigned int line, char *dest, size_t len)
* (This is not redundant with the clobbering above. The
* marking might not actually take effect if we're not running
* under valgrind.) */
- VALGRIND_MAKE_WRITABLE(dest, len);
+// VALGRIND_MAKE_WRITABLE(dest, len);
#endif /* VALGRIND */
#endif /* DEVELOPER */
}
diff --git a/source/lib/crc32.c b/source/lib/crc32.c
index 7522ab7c811..a4ae90c4693 100644
--- a/source/lib/crc32.c
+++ b/source/lib/crc32.c
@@ -93,7 +93,7 @@ uint32 crc32_calc_buffer(const char *buf, size_t size)
const unsigned char *p;
uint32 crc;
- p = buf;
+ p = (const unsigned char *)buf;
crc = ~0U;
while (size--)
diff --git a/source/lib/util_file.c b/source/lib/util_file.c
index 963d610beff..407a8b24fc9 100644
--- a/source/lib/util_file.c
+++ b/source/lib/util_file.c
@@ -525,7 +525,7 @@ static char **file_lines_parse(char *p, size_t size, int *numlines)
char **file_lines_load(const char *fname, int *numlines)
{
char *p;
- size_t size;
+ size_t size = 0;
p = file_load(fname, &size);
if (!p) {