__FPTRCAST(3) - NetBSD Manual Pages

__FPTRCAST(3)           NetBSD Library Functions Manual          __FPTRCAST(3)


NAME
__FPTRCAST -- function pointer cast
SYNOPSIS
#include <sys/cdefs.h> ftype __FPTRCAST(ftype, fname);
DESCRIPTION
The __FPTRCAST() macro can be used to silence warnings produced by cer- tain compilers when converting from one function pointer type to another. The ftype argument is the function pointer type to which to cast the function pointer in fname. This cast should be used sparingly and it is typically used in the fol- lowing situations: · We know that the function prototypes don't match at all, but we don't care because we point it to a function that does not take arguments and returns an error. · We only care about the first few arguments and we don't care about the rest. · We don't care about the return value, we ignore it anyway.
IMPLEMENTATION NOTES
This macro is implemented by using an intermediate void * cast.
SEE ALSO
cc(1), cdefs(3)
CAVEATS
Use of this macro can hide valid errors, and its usage is not recommended unless there is a well-thought reason for a cast. As a general guide- line, don't use this macro inside other macros because it will hide cases where the user of the original macro accidentally used an incorrect func- tion pointer. Use of this macro is non-portable; this is part of the implementation namespace and should only be used in NetBSD code. NetBSD 10.0 October 17, 2013 NetBSD 10.0

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.