Page MenuHomeFreeBSD

Fix build on non-64bit architectures
ClosedPublic

Authored by lwhsu on Jan 25 2018, 5:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 22, 8:43 PM
Unknown Object (File)
Sat, Feb 22, 1:45 AM
Unknown Object (File)
Fri, Jan 31, 4:58 PM
Unknown Object (File)
Jan 23 2025, 3:46 AM
Unknown Object (File)
Dec 18 2024, 1:49 PM
Unknown Object (File)
Oct 22 2024, 4:32 PM
Unknown Object (File)
Sep 29 2024, 8:55 PM
Unknown Object (File)
Sep 17 2024, 12:57 AM
Subscribers

Details

Summary

r328351 seems breaks the architectures where size_t is not unsigned long:

https://ci.freebsd.org/job/FreeBSD-head-mips-build/95/console

00:06:35.591 --- kern_malloc.o ---
00:06:35.591 cc1: warnings being treated as errors
00:06:35.591 /usr/src/sys/kern/kern_malloc.c: In function 'malloc':
00:06:35.591 /usr/src/sys/kern/kern_malloc.c:532: warning: passing argument 2 of 'malloc_dbg' from incompatible pointer type
00:06:35.592 /usr/src/sys/kern/kern_malloc.c: In function 'malloc_domain':
00:06:35.592 /usr/src/sys/kern/kern_malloc.c:582: warning: passing argument 2 of 'malloc_dbg' from incompatible pointer type

BTW, I see more places in this files use unsigned long as size or alignment, should they also be changed?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

First: Sure, this change seems good.

Second: It's not clear to me -- why is size_t not unsigned long on MIPS? Or is this a long vs long long (but both are 64 bits) type complaint?

Third: Yes, John would like many more of those unsigned longs to become size_t. I'm on board. If this is what is needed to unbreak the build, though, there's no need to do that other stuff at the same time.

This revision is now accepted and ready to land.Jan 25 2018, 6:32 AM
This revision was automatically updated to reflect the committed changes.

Thanks, I just wanted to fix the build first.

For the second, I am not sure, either. I guess the compiler just complains about types are different.

For the third, good to know that, I also don't want to do these change at the same time.