Hi Paul,

On 8/22/21 10:12 PM, Paul Eggert wrote:
> Subject: [PATCH 4/4] df: pacify -Wsuggest-attribute=malloc
>
> Problem found with latest Gnulib and GCC 11.2.1.
> * src/find-mount-point.h (find_mount_point):
> Add _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.
> ---
>  src/find-mount-point.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/find-mount-point.h b/src/find-mount-point.h
> index 028b2500c..a1bbcdc92 100644
> --- a/src/find-mount-point.h
> +++ b/src/find-mount-point.h
> @@ -14,4 +14,7 @@
>     You should have received a copy of the GNU General Public License
>     along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
>
> -extern char *find_mount_point (char const *, struct stat const *);
> +#include <stdlib.h>
> +
> +extern char *find_mount_point (char const *, struct stat const *)
> +  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;

`make syntax-check` complains:
  src/find-mount-point.h:17:#include <stdlib.h>
  maint.mk: the above are already included via system.h
  make: *** [cfg.mk:174: sc_system_h_headers] Error 1

The attached fixes it.
Was there a particular reason to include stdlib.h?

Have a nice day,
Berny
>From fd277435c8cc4b758c101b9466fd8e86f4f37807 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Tue, 24 Aug 2021 21:32:26 +0200
Subject: [PATCH] maint: avoid sc_system_h_headers error

`make syntax-check` complains:
  src/find-mount-point.h:17:#include <stdlib.h>
  maint.mk: the above are already included via system.h
  make: *** [cfg.mk:174: sc_system_h_headers] Error 1

* src/find-mount-point.h (#include <stdlib.h>): Remove again.
---
 src/find-mount-point.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/find-mount-point.h b/src/find-mount-point.h
index a1bbcdc92..be0d367be 100644
--- a/src/find-mount-point.h
+++ b/src/find-mount-point.h
@@ -14,7 +14,5 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#include <stdlib.h>
-
 extern char *find_mount_point (char const *, struct stat const *)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
-- 
2.32.0

Reply via email to