From 0a140b7cb718a61093b3a22cf4444e55495c217c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 15 Mar 2019 15:03:14 +0100 Subject: [PATCH] session: ignore pedantic warnings for funcpointer <=> void * --- src/session.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index b327efe4..7a433409 100644 --- a/src/session.c +++ b/src/session.c @@ -510,9 +510,11 @@ libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)), * Set (or reset) a callback function * Returns the prior address * - * FIXME: this function relies on that we can typecast function pointers + * ALERT: this function relies on that we can typecast function pointers * to void pointers, which isn't allowed in ISO C! */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" LIBSSH2_API void * libssh2_session_callback_set(LIBSSH2_SESSION * session, int cbtype, void *callback) @@ -559,6 +561,7 @@ libssh2_session_callback_set(LIBSSH2_SESSION * session, return NULL; } +#pragma GCC diagnostic pop /* * _libssh2_wait_socket() @@ -774,7 +777,7 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) &session->startup_req_state); if(rc) return rc; - + if(session->startup_data_len < 5) { return _libssh2_error(session, LIBSSH2_ERROR_PROTO, "Unexpected packet length");