#: 16052 S12/OS9/68000 (OSK)
27-Jul-92 23:45:38
Sb: #C strangeness
Fm: Bob van der Poel 76510,2203
To: all
I'm writing a bit of C code using data modules and have found an interesting
situation. Most of the module functions are declared as returning a pointer to
a structure of type mod_exec. Further, if these functions fail, they return a
-1.
Now things get interesting. The compiler correctly flags statements like:
if((foo=modlink(woof,type))==-1)...
as an illegal pointer/integer combination. This makes sense since pointers are
by their nature unsigned. So, what casts can one use to satisfy the compiler
and ensure that the proper type conversions are being done?
There is 1 Reply.
|