[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: warning in mingw [Was: [ANN] Lua 5.4.0 (rc1) now available]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 28 Apr 2020 11:16:05 -0300
> >From the documentation of GCC 9.3.0:
> Warn when a function pointer is cast to an incompatible function pointer.
> In a cast involving function types with a variable argument list only the
> types of initial arguments that are provided are considered. Any parameter
> of pointer-type matches any other pointer-type. Any benign differences in
> integral types are ignored, like int vs. long on ILP32 targets. Likewise
> type qualifiers are ignored. The function type void (*) (void) is special
> and matches everything, which can be used to suppress this warning. In a
> cast involving pointer to member types this warning warns whenever the type
> cast is changing the pointer to member type. This warning is enabled by
So, this is a documented GCC thing. Many thanks for the info.
I would support not using this warning, but as it comes with -Wextra
we would need to explicitly turn it off.
We already have several constructions in our code base to avoid
warnings from specific compilers (virtually all warnings are from
specific compilers), such as FALLTHROUGH comments, useless returns
and breaks, useless initialisations, extra parentheses in dubious
expressions, etc. Adding this cast (with a proper comment) doesn't hurt.
lua-l mailing list -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com