Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 17:36:19 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r327883 - in stable/11: include sys/sys
Message-ID:  <201801121736.w0CHaJLI050749@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Jan 12 17:36:19 2018
New Revision: 327883
URL: https://svnweb.freebsd.org/changeset/base/327883

Log:
  MFC r327697, r327699:
  
  Use the __result_use_check attribute for reallocf(9).
  
  MFC r327751:
  Use the __result_use_check attribute also for reallocf(3).
  
  The GCC attribute causes a warning to be emitted if a caller of the
  function with this attribute does not use its return value. Unlike the
  traditional realloc, with reallocf(3) we don't have to check for NULL
  values but we still have to make sure the result is used.

Modified:
  stable/11/include/stdlib.h
  stable/11/sys/sys/malloc.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/include/stdlib.h
==============================================================================
--- stable/11/include/stdlib.h	Fri Jan 12 17:33:20 2018	(r327882)
+++ stable/11/include/stdlib.h	Fri Jan 12 17:36:19 2018	(r327883)
@@ -309,7 +309,7 @@ int	 radixsort(const unsigned char **, int, const unsi
 	    unsigned);
 void	*reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
 	    __alloc_size(3);
-void	*reallocf(void *, size_t) __alloc_size(2);
+void	*reallocf(void *, size_t) __result_use_check __alloc_size(2);
 int	 rpmatch(const char *);
 void	 setprogname(const char *);
 int	 sradixsort(const unsigned char **, int, const unsigned char *,

Modified: stable/11/sys/sys/malloc.h
==============================================================================
--- stable/11/sys/sys/malloc.h	Fri Jan 12 17:33:20 2018	(r327882)
+++ stable/11/sys/sys/malloc.h	Fri Jan 12 17:36:19 2018	(r327883)
@@ -184,7 +184,7 @@ void	malloc_uninit(void *);
 void	*realloc(void *addr, unsigned long size, struct malloc_type *type,
 	    int flags) __result_use_check __alloc_size(2);
 void	*reallocf(void *addr, unsigned long size, struct malloc_type *type,
-	    int flags) __alloc_size(2);
+	    int flags) __result_use_check __alloc_size(2);
 
 struct malloc_type *malloc_desc2type(const char *desc);
 #endif /* _KERNEL */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801121736.w0CHaJLI050749>