sg3_utils icon indicating copy to clipboard operation
sg3_utils copied to clipboard

1.47 fails to build with musl due to use of `uint`

Open ncopa opened this issue 2 years ago • 2 comments

Build fails on alpine linux with the following error:

gcc -DHAVE_CONFIG_H -I. -I..  -iquote ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -fomit-frame-pointer -Wall -W  -Os -fomit-frame-pointer -MT sg_dd.o -MD -MP -MF .deps/sg_dd.Tpo -c -o sg_dd.o sg_dd.c
sg_dd.c: In function 'main':
sg_dd.c:2402:17: error: unknown type name 'uint'; did you mean 'int'?
 2402 |                 uint off;
      |                 ^~~~
      |                 int
make[2]: *** [Makefile:1172: sg_dd.o] Error 1

ncopa avatar Jan 28 '22 15:01 ncopa

Fix is trivial:

diff --git a/src/sg_dd.c b/src/sg_dd.c
index 9d05c93..7662728 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -2399,7 +2399,7 @@ main(int argc, char * argv[])
             res = blocks * blk_sz;
             if (iflag.zero && iflag.ff && (blk_sz >= 4)) {
                 uint32_t pos = (uint32_t)skip;
-                uint off;
+                unsigned int off;
 
                 for (k = 0, off = 0; k < blocks; ++k, off += blk_sz, ++pos) {
                     for (j = 0; j < (blk_sz - 3); j += 4)

ncopa avatar Jan 28 '22 15:01 ncopa

This has been fixed in my upstream version. See: https://github.com/doug-gilbert/sg3_utils

Thanks.

doug-gilbert avatar Feb 02 '22 15:02 doug-gilbert

Fixed with 1.48.

hreinecke avatar Aug 17 '23 06:08 hreinecke