mirror of
				https://git.proxmox.com/git/mirror_zfs
				synced 2025-11-04 05:22:48 +00:00 
			
		
		
		
	GCC 7.1 with will warn when we're not checking the snprintf() return code in cases where the buffer could be truncated. This patch either checks the snprintf return code (where applicable), or simply disables the warnings (ztest.c). Reviewed-by: Chunwei Chen <david.chen@osnexus.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes #6253
		
			
				
	
	
		
			23 lines
		
	
	
		
			482 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			482 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
dnl #
 | 
						|
dnl # Check if gcc supports -Wno-format-truncation option.
 | 
						|
dnl #
 | 
						|
AC_DEFUN([ZFS_AC_CONFIG_USER_NO_FORMAT_TRUNCATION], [
 | 
						|
	AC_MSG_CHECKING([for -Wno-format-truncation support])
 | 
						|
 | 
						|
	saved_flags="$CFLAGS"
 | 
						|
	CFLAGS="$CFLAGS -Wno-format-truncation"
 | 
						|
 | 
						|
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
 | 
						|
	[
 | 
						|
		NO_FORMAT_TRUNCATION=-Wno-format-truncation
 | 
						|
		AC_MSG_RESULT([yes])
 | 
						|
	],
 | 
						|
	[
 | 
						|
		NO_FORMAT_TRUNCATION=
 | 
						|
		AC_MSG_RESULT([no])
 | 
						|
	])
 | 
						|
 | 
						|
	CFLAGS="$saved_flags"
 | 
						|
	AC_SUBST([NO_FORMAT_TRUNCATION])
 | 
						|
])
 |