tech-toolchain archive

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

toolchain/58663: gpt(1) biosboot.c doesn't compile on modern Linux



Kia ora koutou,
While looking at JBG's problems uncovered by GCC 14 I found a tools
portability bug in gpt(1) biosboot.c and filed the above PR for it.
The fix is super trivial, but since I'm a newly minted NetBSD developer
I'm supposed to get source changes reviews. If someone gives the PR an
okey-dokey, I'll get on with committing the following patch to CVS.
The problem is that daddr_t and off_t are 32 bits and 64 bits in size
respectively on Linux and then pointers get screwy.
diff -r 3a2c38eb3772 sbin/gpt/biosboot.c
--- a/sbin/gpt/biosboot.c Tue Sep 03 19:51:02 2024 +0000
+++ b/sbin/gpt/biosboot.c Wed Sep 04 15:08:01 2024 +1200
@@ -267,7 +267,7 @@
 #endif
 int ch;
 gpt_t ngpt = gpt;
- daddr_t start = 0;
+ off_t start = 0; /* off_t because of gpt_human_get() */
 uint64_t size = 0;
 int active = 0;
 unsigned int entry = 0;
Ngā mihi,
Lloyd


Home | Main Index | Thread Index | Old Index

AltStyle によって変換されたページ (->オリジナル) /