From 6d9308d93c7b7d9b86b580a9ccc9d8a15dd6155b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 8 May 2021 19:51:01 +0100 Subject: [PATCH] fix a couple of compiler warnings --- libvips/iofuncs/buf.c | 4 ++++ libvips/iofuncs/util.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libvips/iofuncs/buf.c b/libvips/iofuncs/buf.c index f3b08c2e..bcf67e20 100644 --- a/libvips/iofuncs/buf.c +++ b/libvips/iofuncs/buf.c @@ -279,8 +279,12 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz ) /* Can't use vips_strncpy() here, we don't want to drop the end of the * string. + * + * gcc10 issues a false-positive warning about this. */ +#pragma GCC diagnostic push strncpy( buf->base + buf->i, str, cpy ); +#pragma GCC diagnostic pop buf->i += cpy; if( buf->i >= buf->mx - 4 ) { diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index ae697097..cab00298 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -613,7 +613,7 @@ vips__set_create_time( int fd ) SYSTEMTIME st; FILETIME ft; - if( (handle = _get_osfhandle( fd )) == INVALID_HANDLE_VALUE ) + if( (handle = (HANDLE) _get_osfhandle( fd )) == INVALID_HANDLE_VALUE ) return; GetSystemTime( &st ); SystemTimeToFileTime( &st, &ft );