diff --git a/client/common/file.c b/client/common/file.c index 0c2750454..855e126d8 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -886,6 +886,8 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u return (status == 0) ? TRUE : FALSE; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* bufferSize, const char* fmt, ...) { @@ -901,10 +903,7 @@ static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* buf bufSize = *bufferSize; va_start(ap, fmt); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" len = vsnprintf(buf, bufSize, fmt, ap); -#pragma GCC diagnostic pop va_end(ap); if (len < 0) return -1; @@ -931,6 +930,7 @@ static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* buf return len; } +#pragma GCC diagnostic pop size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, size_t size) { diff --git a/winpr/libwinpr/utils/trio/trio.c b/winpr/libwinpr/utils/trio/trio.c index b3da6e228..2e1bca5cb 100644 --- a/winpr/libwinpr/utils/trio/trio.c +++ b/winpr/libwinpr/utils/trio/trio.c @@ -1391,6 +1391,8 @@ TRIO_ARGS1((base), * Description: * Parse the qualifiers of a potential conversion specifier */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" TRIO_PRIVATE int TrioParseQualifiers TRIO_ARGS4((type, format, offset, parameter), @@ -1417,8 +1419,6 @@ TRIO_ARGS4((type, format, offset, parameter), { ch = format[offset++]; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" switch (ch) { case QUALIFIER_SPACE: @@ -1682,7 +1682,6 @@ TRIO_ARGS4((type, format, offset, parameter), /* Bail out completely to make the error more obvious */ return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); } -#pragma GCC diagnostic pop } /* while qualifier */ @@ -1690,6 +1689,7 @@ TRIO_ARGS4((type, format, offset, parameter), return 0; } +#pragma GCC diagnostic pop /************************************************************************* * TrioParseSpecifier @@ -1697,6 +1697,8 @@ TRIO_ARGS4((type, format, offset, parameter), * Description: * Parse the specifier part of a potential conversion specifier */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" TRIO_PRIVATE int TrioParseSpecifier TRIO_ARGS4((type, format, offset, parameter), @@ -1707,8 +1709,6 @@ TRIO_ARGS4((type, format, offset, parameter), { parameter->baseSpecifier = NO_BASE; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" switch (format[offset++]) { #if defined(SPECIFIER_CHAR_UPPER) @@ -1935,12 +1935,12 @@ TRIO_ARGS4((type, format, offset, parameter), /* Bail out completely to make the error more obvious */ return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); } -#pragma GCC diagnostic pop parameter->endOffset = offset; return 0; } +#pragma GCC diagnostic pop /************************************************************************* * TrioParse