__FPTRCAST(3)
๐ __FPTRCAST(3) โ Library Functions Manual ๐
okay so bestie, welcome to __FPTRCAST(3) from the Library Functions Manual โ this is the little macro that does a function pointer cast and gives certain compiler warnings a polite little โnot todayโ ๐
.
NAME
__FPTRCAST โ function pointer cast, no cap.
SYNOPSIS
#include <sys/cdefs.h>
ftype
__FPTRCAST(ftype, fname);
DESCRIPTION
okay so the __FPTRCAST() macro can be used to silence warnings produced by certain 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, bestie โ like, itโs not a cute little accessory, itโs a โwe have a reasonโ kind of move. Itโs typically used in the following 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
Under the hood, this macro is implemented by using an intermediate void * cast. Thatโs the whole note, icon. ๐
SEE ALSO
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 guideline, donโt use this macro inside other macros because it will hide cases where the user of the original macro accidentally used an incorrect function pointer. ๐ญ
Use of this macro is non-portable; this is part of the implementation namespace and should only be used in NetBSD code. ๐ซถ
๐ okay thatโs the page, bestie! This one is from Debian, dated October 17, 2013, and itโs literally __FPTRCAST(3) โ bye, go cast responsibly ๐
๐ฆ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2019 The NetBSD Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms