Re: Typecasting a void pointer to unsigned long in zsmalloc.c

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

 



On Thu, Jan 23, 2025 at 04:52:24PM +0100, Sotir Danailov wrote:
> What's the guarantee that an unsigned long can hold the data
> from the void pointer?

This is a requirement that Linux makes for the compiler to work with
it for any platform that Linux runs on.

> Is this safe to do?

Yes.

> Shouldn't there be a special type for doing this type of conversion?

That type is "unsigned long" :)

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux