theft
theft copied to clipboard
MSVC and clang-cl compilation errors
I tried to compile Theft using my meson branch and got the following errors on Windows machine with MSVC:
"cl" "-Isubprojects\theft\libtheft.a.p" "-Isubprojects\theft" "-I..\subprojects\theft" "-I..\subprojects\theft\inc" "-I..\subprojects\theft\vendor" "/MT" "/nologo" "/showIncludes" "/utf-8" "/W4" "/O2" "/Gw" "-D_POSIX_C_SOURCE=199309L" "-D_C99_SOURCE" "-pedantic" "/Fdsubprojects\theft\libtheft.a.p\src_theft.c.pdb" /Fosubprojects/theft/libtheft.a.p/src_theft.c.obj "/c" ../subprojects/theft/src/theft.c
cl : Command line warning D9002 : ignoring unknown option '-pedantic'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(122): error C2061: syntax error: identifier 'pid_t'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(124): error C2059: syntax error: '}'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(139): error C2079: 'workers' uses undefined struct 'worker_info'
../subprojects/theft/src/theft.c(53): warning C4204: nonstandard extension used: non-constant aggregate initializer
../subprojects/theft/src/theft.c(50): warning C4204: nonstandard extension used: non-constant aggregate initializer
../subprojects/theft/src/theft.c(55): warning C4204: nonstandard extension used: non-constant aggregate initializer
[141/2333] Compiling C object subprojects/theft/libtheft.a.p/src_theft_autoshrink.c.obj
FAILED: subprojects/theft/libtheft.a.p/src_theft_autoshrink.c.obj
"cl" "-Isubprojects\theft\libtheft.a.p" "-Isubprojects\theft" "-I..\subprojects\theft" "-I..\subprojects\theft\inc" "-I..\subprojects\theft\vendor" "/MT" "/nologo" "/showIncludes" "/utf-8" "/W4" "/O2" "/Gw" "-D_POSIX_C_SOURCE=199309L" "-D_C99_SOURCE" "-pedantic" "/Fdsubprojects\theft\libtheft.a.p\src_theft_autoshrink.c.pdb" /Fosubprojects/theft/libtheft.a.p/src_theft_autoshrink.c.obj "/c" ../subprojects/theft/src/theft_autoshrink.c
cl : Command line warning D9002 : ignoring unknown option '-pedantic'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(122): error C2061: syntax error: identifier 'pid_t'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(124): error C2059: syntax error: '}'
c:\projects\rizin\subprojects\theft\src\theft_types_internal.h(139): error C2079: 'workers' uses undefined struct 'worker_info'
../subprojects/theft/src/theft_autoshrink.c(22): warning C4204: nonstandard extension used: non-constant aggregate initializer
../subprojects/theft/src/theft_autoshrink.c(56): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(61): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(77): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(81): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(84): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(99): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(128): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(131): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(119): warning C4244: 'initializing': conversion from 'const uint32_t' to 'const uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(178): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(190): warning C4204: nonstandard extension used: non-constant aggregate initializer
../subprojects/theft/src/theft_autoshrink.c(274): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(276): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(284): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(287): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(289): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(326): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(327): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(343): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(344): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(386): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(446): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(453): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(512): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(557): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(560): warning C4267: '=': conversion from 'size_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(572): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(576): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(586): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(625): warning C4456: declaration of 'pos' hides previous local declaration
../subprojects/theft/src/theft_autoshrink.c(614): note: see declaration of 'pos'
../subprojects/theft/src/theft_autoshrink.c(630): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(632): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(638): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(640): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(643): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(661): warning C4146: unary minus operator applied to unsigned type, result still unsigned
../subprojects/theft/src/theft_autoshrink.c(664): warning C4456: declaration of 'pos' hides previous local declaration
../subprojects/theft/src/theft_autoshrink.c(614): note: see declaration of 'pos'
../subprojects/theft/src/theft_autoshrink.c(669): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(671): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(676): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(678): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(681): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(713): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(722): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(723): warning C4244: 'function': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(730): warning C4244: 'function': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(732): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(733): warning C4244: 'function': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(734): warning C4244: 'function': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(740): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(749): warning C4456: declaration of 'pos' hides previous local declaration
../subprojects/theft/src/theft_autoshrink.c(614): note: see declaration of 'pos'
../subprojects/theft/src/theft_autoshrink.c(753): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(755): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(760): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(766): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(771): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(624): warning C4244: 'initializing': conversion from 'uint64_t' to 'const uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(656): warning C4244: 'initializing': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(695): warning C4244: 'initializing': conversion from 'uint64_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(747): warning C4244: 'initializing': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(816): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(905): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(908): warning C4244: 'function': conversion from 'uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(918): error C2057: expected constant expression
../subprojects/theft/src/theft_autoshrink.c(918): error C2133: 'left_pad': unknown size
../subprojects/theft/src/theft_autoshrink.c(939): warning C4244: 'function': conversion from 'const uint32_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(871): warning C4244: 'initializing': conversion from 'uint64_t' to 'const uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(929): warning C4244: 'initializing': conversion from 'uint64_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(939): warning C4244: 'initializing': conversion from 'uint64_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(987): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1030): warning C4267: '=': conversion from 'size_t' to 'uint8_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(1059): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1075): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1078): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1081): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1084): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1087): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1090): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1074): warning C4244: 'initializing': conversion from 'uint64_t' to 'const uint16_t', possible loss of data
../subprojects/theft/src/theft_autoshrink.c(1107): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1111): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1143): warning C4127: conditional expression is constant
../subprojects/theft/src/theft_autoshrink.c(1153): warning C4127: conditional expression is constant
And here what I get with clang-cl:
[140/2359] Compiling C object subprojects/theft/theft.dll.p/src_theft.c.obj
FAILED: subprojects/theft/theft.dll.p/src_theft.c.obj
"clang-cl" "-Isubprojects\theft\theft.dll.p" "-Isubprojects\theft" "-I..\subprojects\theft" "-I..\subprojects\theft\inc" "-I..\subprojects\theft\vendor" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W4" "/clang:-std=c99" "/O2" "/Gw" "-D_POSIX_C_SOURCE=199309L" "-D_C99_SOURCE" "-pedantic" "/Fdsubprojects\theft\theft.dll.p\src_theft.c.pdb" /Fosubprojects/theft/theft.dll.p/src_theft.c.obj "/c" ../subprojects/theft/src/theft.c
clang-cl: warning: unknown argument ignored in clang-cl: '-pedantic' [-Wunknown-argument]
In file included from ../subprojects/theft/src/theft.c:5:
../subprojects/theft/src\theft_types_internal.h(122,5): error: unknown type name 'pid_t'
122 | pid_t pid;
| ^
1 error generated.
[141/2359] Compiling C object subprojects/theft/theft.dll.p/src_theft_autoshrink.c.obj
FAILED: subprojects/theft/theft.dll.p/src_theft_autoshrink.c.obj
"clang-cl" "-Isubprojects\theft\theft.dll.p" "-Isubprojects\theft" "-I..\subprojects\theft" "-I..\subprojects\theft\inc" "-I..\subprojects\theft\vendor" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W4" "/clang:-std=c99" "/O2" "/Gw" "-D_POSIX_C_SOURCE=199309L" "-D_C99_SOURCE" "-pedantic" "/Fdsubprojects\theft\theft.dll.p\src_theft_autoshrink.c.pdb" /Fosubprojects/theft/theft.dll.p/src_theft_autoshrink.c.obj "/c" ../subprojects/theft/src/theft_autoshrink.c
clang-cl: warning: unknown argument ignored in clang-cl: '-pedantic' [-Wunknown-argument]
In file included from ../subprojects/theft/src/theft_autoshrink.c:1:
In file included from ../subprojects/theft/src\theft_autoshrink_internal.h:4:
../subprojects/theft/src\theft_types_internal.h(122,5): error: unknown type name 'pid_t'
122 | pid_t pid;
| ^
1 error generated.
pid_t comes from unistd.h. This project assumes it's building in a Unix-like environment, I wouldn't expect it to build or meaningfully work on Windows without a lot of extra porting work.