Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2018 22:48:13 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327751 - head/include
Message-ID:  <201801092248.w09MmDG1046084@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Tue Jan  9 22:48:13 2018
New Revision: 327751
URL: https://svnweb.freebsd.org/changeset/base/327751

Log:
  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.
  
  MFC after:	3 days

Modified:
  head/include/stdlib.h

Modified: head/include/stdlib.h
==============================================================================
--- head/include/stdlib.h	Tue Jan  9 22:00:06 2018	(r327750)
+++ head/include/stdlib.h	Tue Jan  9 22:48:13 2018	(r327751)
@@ -304,7 +304,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 *,



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