"Michael Glickman" <[EMAIL PROTECTED]> wrote in message
news:70981@palm-dev-forum...
>
> GCC would give a warning in this case (when used with -Wall), will CW
?

The problem line was:

DmWrite( MemHandleLock( h ), 0, h2, size );

The third parameter to DmWrite is a "const void *".  Since a MemHandle
is defined as a "struct _opaque *" by the PalmTypes.h header, it
converts silently into a const pointer to void, since both C and C++
allow any pointer to become a pointer to void (C++ disallows the other
way).

I don't think there is a way to get CodeWarrior to warn about this,
since it is valid C.  In a sense, it would be a lot better if MemHandle
was defined as a 4-byte struct, since that can't silently convert to
anything -- however, a struct like that wouldn't be able to be stored in
a register as a temporary by the compiler due to the more complicated
type.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to