diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-30 21:07:55 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-30 21:07:55 -0200 |
commit | 2419cec9f1ca35053feca7311a2f8d94f4198606 (patch) | |
tree | 3a6628be68aeed877ea2ab4505d3f24bc1b62185 /mysys | |
parent | 0008e06489cc3c346ee4ab62f89f20ac404f9472 (diff) | |
download | mariadb-git-2419cec9f1ca35053feca7311a2f8d94f4198606.tar.gz |
Workaround a GCC warning about a pointer being cast to a larger
integral type. Use intptr which is designed to hold pointer values
and pass it to off_t.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/stacktrace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index b6bf88cf3e1..93e8ae6b508 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -87,8 +87,11 @@ static int safe_print_str(const char *addr, int max_len) if ((fd= open(buf, O_RDONLY)) < 0) return -1; + /* Ensure that off_t can hold a pointer. */ + compile_time_assert(sizeof(off_t) >= sizeof(intptr)); + total= max_len; - offset= (off_t) addr; + offset= (intptr) addr; /* Read up to the maximum number of bytes. */ while (total) |