diff --git a/channels/client/addin.c b/channels/client/addin.c index 958ef82e2..bdd9400b5 100644 --- a/channels/client/addin.c +++ b/channels/client/addin.c @@ -494,15 +494,20 @@ PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, LP 0) || /* we only want to know if strnlen is > 0 */ (strncmp(subsystems->name, pszSubsystem, MAX_PATH) == 0)) { + /* cast with union trick to avoid -Wcast-function-type-strict */ + union + { + PVIRTUALCHANNELENTRY pvce; + static_subsystem_entry_fn_t entry; + } cnv; + cnv.entry = subsystems->entry; if (pszType) { if (strncmp(subsystems->type, pszType, MAX_PATH) == 0) - return (PVIRTUALCHANNELENTRY)subsystems->entry; + return cnv.pvce; } else - { - return (PVIRTUALCHANNELENTRY)subsystems->entry; - } + return cnv.pvce; } } } diff --git a/libfreerdp/primitives/prim_copy.c b/libfreerdp/primitives/prim_copy.c index 4b9a2a265..895dc2eae 100644 --- a/libfreerdp/primitives/prim_copy.c +++ b/libfreerdp/primitives/prim_copy.c @@ -377,8 +377,16 @@ void primitives_init_copy(primitives_t* prims) /* Start with the default. */ prims->copy_8u = general_copy_8u; prims->copy_8u_AC4r = general_copy_8u_AC4r; - /* This is just an alias with void* parameters */ - prims->copy = (__copy_t)(prims->copy_8u); + /* This is just an alias with void* parameters + * cast with union trick to avoid -Wcast-function-type-strict + */ + union + { + __copy_8u_t ufkt; + __copy_t fkt; + } cnv; + cnv.ufkt = prims->copy_8u; + prims->copy = cnv.fkt; prims->copy_no_overlap = generic_image_copy_no_overlap; } diff --git a/winpr/tools/makecert/makecert.c b/winpr/tools/makecert/makecert.c index a94e98697..9bcf7763c 100644 --- a/winpr/tools/makecert/makecert.c +++ b/winpr/tools/makecert/makecert.c @@ -261,8 +261,9 @@ fallback: return computerName; } -static int command_line_pre_filter(MAKECERT_CONTEXT* context, int index, int argc, LPCSTR* argv) +static int command_line_pre_filter(void* pvctx, int index, int argc, LPSTR* argv) { + MAKECERT_CONTEXT* context = pvctx; if (!context || !argv || (index < 0) || (argc < 0)) return -1; @@ -299,8 +300,7 @@ static int makecert_context_parse_arguments(MAKECERT_CONTEXT* context, CommandLineClearArgumentsA(args); flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SIGIL_DASH; status = - CommandLineParseArgumentsA(argc, argv, args, flags, context, - (COMMAND_LINE_PRE_FILTER_FN_A)command_line_pre_filter, NULL); + CommandLineParseArgumentsA(argc, argv, args, flags, context, command_line_pre_filter, NULL); if (status & COMMAND_LINE_STATUS_PRINT_HELP) {