Skip to content

Commit 2db4919

Browse files
Jim Meyeringfacebook-github-bot
Jim Meyering
authored andcommitted
thrift/lib/py/protocol/fastproto.cpp: suppress llvm-19-exposed -Wcast-function-type-mismatch warnings
Summary: This unblocks the llvm19 build of fb-smcc: D71070914 This avoids the following errors: thrift/lib/py/protocol/fastproto.cpp:1192:16: error: cast from 'PyObject *(*)(PyObject *, PyObject *, PyObject *)' (aka '_object *(*)(_object *, _object *, _object *)') to 'PyCFunction' (aka '_object *(*)(_object *, _object *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] thrift/lib/py/protocol/fastproto.cpp:1193:16: error: cast from 'PyObject *(*)(PyObject *, PyObject *, PyObject *)' (aka '_object *(*)(_object *, _object *, _object *)') to 'PyCFunction' (aka '_object *(*)(_object *, _object *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] Reviewed By: dtolnay Differential Revision: D71121409 fbshipit-source-id: 6e68a6105b1a00b9a043a879f329cea27038a514
1 parent ed54c3d commit 2db4919

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

third-party/thrift/src/thrift/lib/py/protocol/fastproto.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1187,13 +1187,16 @@ static PyObject* decode(PyObject* /*self*/, PyObject* args, PyObject* kws) {
11871187

11881188
/* -- PYTHON MODULE SETUP STUFF --- */
11891189

1190+
FOLLY_PUSH_WARNING
1191+
FOLLY_GNU_DISABLE_WARNING("-Wcast-function-type-mismatch")
11901192
static PyMethodDef ThriftFastProtoMethods[] = {
11911193

11921194
{"encode", (PyCFunction)encode, METH_VARARGS | METH_KEYWORDS, ""},
11931195
{"decode", (PyCFunction)decode, METH_VARARGS | METH_KEYWORDS, ""},
11941196

11951197
{nullptr, nullptr, 0, nullptr} /* Sentinel */
11961198
};
1199+
FOLLY_POP_WARNING
11971200

11981201
extern "C" {
11991202
struct module_state {

0 commit comments

Comments
 (0)