Re: [OT] C programming problem

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

 



On Wed, Feb 07, 2018 at 07:46:13PM +0000, Wol's lists wrote:
> It is for raid, honest :-)
> 
> My C is so rusty it's jammed solid :-) but I'm trying to prototype a simple
> algorithm for "de-clustering" a raid-60/61 array.
> 
> Googling for my error -
> 
> main.c:20:5: warning: incompatible implicit declaration of built-in function
> ‘memset’ [enabled by default]
>      memset( &array, 0, blocks * sizeof(int) );
> 
> says "you need to include stdlib.h" - but I have!

You need to include string.h. See "man memset" (if your distro
has those).

I tried your code and I didn't get a warning or error for
malloc(). stdlib.h should be fine for malloc().
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux