autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to test for a prototype difference


From: Thomas Klausner
Subject: how to test for a prototype difference
Date: Thu, 1 May 2014 02:12:45 +0200

Hi!

I 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]