-
Notifications
You must be signed in to change notification settings - Fork 157
Description
Originally mentioned here, there's an ongoing build issue with recent OpenWatcom 2.0 snapshots requiring -wcd=106 to suppress typecasting related warnings so build can continue.
I suppose the CI was changed to use a tagged release of OpenWatcom because of the warnings, per 4e23a63. Older OpenWatcom snapshots did not not produce the warnings and thus no need to suppress.
After some digging the warning seems to be caused by the failure(x) macro here. It seems S_ERROR being 0x8000 is making the compiler implicitly assume unsigned int which caused the warning. If I put an explicit cast in the macro, say,
#define failure(x) (int)(S_ERROR+S_DONE+x)
then all but one such warnings would be gone. The only one left is this return that did not utilize the failure(x) macro so I have to manually put an explicit cast matching the function's return type. After adding those explicit casts the build process completed without other issues.
After building, I did checksums on the previous kernel build with -wcd=106 and the current one with the explicit cast added. Both have identical checksums, so it appears the generated code are likely the same.
I don't know which should be the most appropriate type for the failure(x) macro to explicit cast into. From OpenWatcom's warnings, at least in dsk.c, some places expected int while others short.