ACK: [PATCH] acpica: rename vsnprintf and sprintf in utprint.c to avoid name clash conflicts
ivanhu
ivan.hu at canonical.com
Thu Aug 18 09:05:16 UTC 2016
On 2016年08月18日 16:46, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> This temporary hack fixes build issues on s390x builds:
>
> source/components/utilities/utprint.c:505:1: error: conflicting types for ‘vsnprintf’
> vsnprintf (
> ^
> In file included from /usr/include/features.h:367:0,
> from /usr/include/unistd.h:25,
> from ./source/include/platform/aclinux.h:253,
> from ./source/include/platform/acenv.h:257,
> from ./source/include/acpi.h:128,
> from source/components/utilities/utprint.c:116:
> /usr/include/s390x-linux-gnu/bits/stdio2.h:74:1: note: previous definition of ‘vsnprintf’ was here
> __NTH (vsnprintf (char *__restrict __s, size_t __n,
> ^
> source/components/utilities/utprint.c:801:1: error: conflicting types for ‘snprintf’
> snprintf (
> ^
> In file included from /usr/include/features.h:367:0,
> from /usr/include/unistd.h:25,
> from ./source/include/platform/aclinux.h:253,
> from ./source/include/platform/acenv.h:257,
> from ./source/include/acpi.h:128,
> from source/components/utilities/utprint.c:116:
> /usr/include/s390x-linux-gnu/bits/stdio2.h:61:1: note: previous definition of ‘snprintf’ was here
> __NTH (snprintf (char *__restrict __s, size_t __n,
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpica/source/components/utilities/utprint.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/acpica/source/components/utilities/utprint.c b/src/acpica/source/components/utilities/utprint.c
> index 552656f..1ff3229 100644
> --- a/src/acpica/source/components/utilities/utprint.c
> +++ b/src/acpica/source/components/utilities/utprint.c
> @@ -501,8 +501,8 @@ AcpiUtFormatNumber (
> *
> ******************************************************************************/
>
> -int
> -vsnprintf (
> +static int
> +__vsnprintf (
> char *String,
> ACPI_SIZE Size,
> const char *Format,
> @@ -798,7 +798,7 @@ vsnprintf (
> ******************************************************************************/
>
> int
> -snprintf (
> +__snprintf (
> char *String,
> ACPI_SIZE Size,
> const char *Format,
> @@ -809,7 +809,7 @@ snprintf (
>
>
> va_start (Args, Format);
> - Length = vsnprintf (String, Size, Format, Args);
> + Length = __vsnprintf (String, Size, Format, Args);
> va_end (Args);
>
> return (Length);
> @@ -840,7 +840,7 @@ sprintf (
>
>
> va_start (Args, Format);
> - Length = vsnprintf (String, ACPI_UINT32_MAX, Format, Args);
> + Length = __vsnprintf (String, ACPI_UINT32_MAX, Format, Args);
> va_end (Args);
>
> return (Length);
> @@ -871,7 +871,7 @@ vprintf (
>
>
> Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
> - Length = vsnprintf (AcpiGbl_PrintBuffer,
> + Length = __vsnprintf (AcpiGbl_PrintBuffer,
> sizeof (AcpiGbl_PrintBuffer), Format, Args);
>
> (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, ACPI_FILE_OUT);
> @@ -935,7 +935,7 @@ vfprintf (
>
>
> Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
> - Length = vsnprintf (AcpiGbl_PrintBuffer,
> + Length = __vsnprintf (AcpiGbl_PrintBuffer,
> sizeof (AcpiGbl_PrintBuffer), Format, Args);
>
> (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File);
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list