bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/27] dirname: improve -fanalyzer malloc checking


From: Bruno Haible
Subject: Re: [PATCH 04/27] dirname: improve -fanalyzer malloc checking
Date: Sat, 07 Aug 2021 15:13:24 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

Paul Eggert wrote:
> diff --git a/lib/dirname.h b/lib/dirname.h
> index 492a4381f..04f823eca 100644
> --- a/lib/dirname.h
> +++ b/lib/dirname.h
> @@ -21,6 +21,7 @@
>  
>  # include <stdbool.h>
>  # include <stddef.h>
> +# include <stdlib.h>
>  # include "filename.h"
>  # include "basename-lgpl.h"
>  

Now that <stdlib.h> is included, the <stddef.h> include is no longer necessary
(since this module does not use 'offsetof' nor 'ptrdiff_t'). Similarly in a
couple of other files.


2021-08-07  Bruno Haible  <bruno@clisp.org>

        dirname-lgpl, sh-quote, system-quote, xstriconv: Clean up includes.
        * lib/dirname.h: Don't include <stddef.h>.
        * lib/sh-quote.h: Likewise.
        * lib/system-quote.h: Likewise.
        * lib/xstriconv.h: Likewise.

diff --git a/lib/dirname.h b/lib/dirname.h
index 04f823e..25abc7b 100644
--- a/lib/dirname.h
+++ b/lib/dirname.h
@@ -20,7 +20,6 @@
 # define DIRNAME_H_ 1
 
 # include <stdbool.h>
-# include <stddef.h>
 # include <stdlib.h>
 # include "filename.h"
 # include "basename-lgpl.h"
diff --git a/lib/sh-quote.h b/lib/sh-quote.h
index 0101036..ab440c6 100644
--- a/lib/sh-quote.h
+++ b/lib/sh-quote.h
@@ -22,7 +22,6 @@
    arguments, since Unix shells interpret characters like " ", "'", "<", ">",
    "$", '*', '?' etc. in a special way.  */
 
-#include <stddef.h>
 #include <stdlib.h>
 
 #ifdef __cplusplus
diff --git a/lib/system-quote.h b/lib/system-quote.h
index b1bbf65..6cfddd0 100644
--- a/lib/system-quote.h
+++ b/lib/system-quote.h
@@ -46,7 +46,6 @@
       is to truncate the entire command line.
  */
 
-#include <stddef.h>
 #include <stdlib.h>
 
 #ifdef __cplusplus
diff --git a/lib/xstriconv.h b/lib/xstriconv.h
index d90aa4c..879a772 100644
--- a/lib/xstriconv.h
+++ b/lib/xstriconv.h
@@ -18,7 +18,6 @@
 #ifndef _XSTRICONV_H
 #define _XSTRICONV_H
 
-#include <stddef.h>
 #include <stdlib.h>
 #if HAVE_ICONV
 #include <iconv.h>
@@ -72,6 +71,7 @@ extern char * xstr_iconv (const char *src,
                           const char *from_codeset, const char *to_codeset)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
+
 #ifdef __cplusplus
 }
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]