autoconf-archive-maintainers | |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to detect prototype differences?
From: |
Thomas Klausner |
Subject: |
How to detect prototype differences? |
Date: |
Thu, 13 Feb 2014 10:28:29 +0100 |
Hi!
I recently found out that the prototypes for backtrace and
backtrace_symbol differ on some operating systems.
These are the same:
Linux:
int backtrace(void **buffer, int size);
char **backtrace_symbols(void *const *buffer, int size);
void backtrace_symbols_fd(void *const *buffer, int size, int fd);
Mac OS X:
int backtrace(void **buffer, int size);
char **backtrace_symbols(void *const *buffer, int size);
void backtrace_symbols_fd(void* const* array, int size, int fd);
SunOS:
int backtrace(void **buffer, int size);
char **backtrace_symbols(void *const *buffer, int size);
void backtrace_symbols_fd(void *const *buffer, int size, int fd);
This one's different:
NetBSD:
size_t backtrace(void **addrlist, size_t len);
char **backtrace_symbols(void * const *addrlist, size_t len);
int backtrace_symbols_fd(void * const *addrlist, size_t len, int fd);
The main difference is that on NetBSD, size_t is used for most
arguments that are int on the other systems; also,
backtrace_symbols_fd returns an int.
I'd like to test for the difference int <-> size_t in a configure
script so I can get integer type/sign conversion-warnings free code on
all these operating systems.
I'm however not sure how to do this. Does anyone have a suggestion?
Thanks,
Thomas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- How to detect prototype differences?,
Thomas Klausner <=