Re: [PATCH 4/4] common/drive.c: include stdlib.h

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

 



On 11/28/18 10:56 AM, Jan Tulak wrote:
> We are using calloc() inside of this file, but it is not included in any
> way (resultin in "implicit declaration" warnings from the compiler). So,
> add the include.
> 
> Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
> ---
>  common/drive.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/drive.c b/common/drive.c
> index 4b0825f..edb63c0 100644
> --- a/common/drive.c
> +++ b/common/drive.c
> @@ -17,6 +17,7 @@
>   */
>  
>  #include <stdio.h>
> +#include <stdlib.h>
>  #include <unistd.h>
>  #include <sys/stat.h>
>  #include <time.h>


Seems fine, but why don't these files complain too?

# find . -name \*.c | xargs grep -lw calloc | xargs grep -L stdlib.h

./inventory/inv_oref.c
./inventory/inv_core.c
./inventory/inv_mgr.c
./inventory/testmain.c
(ok, narrator: because they aren't built?)

./common/global.c
./common/fs.c

*shrug* 

If it fixes a warning I'm not going dig too much, seems fine.

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Thanks,
-Eric



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux