Wow...so the compiler won't even warn in this case. I hate to say that, but I usually just do a "make" after editing tons of lines of codes and hope that the compiler tells me all grammer problems, such as using "Char" when "Char *" is needed, missing "}", wrong constant names... I had learned some hard lessons on this, but I am still doing it. It seems fine for me so far.
Max --- Ben Combee <[EMAIL PROTECTED]> wrote: > "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/ __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
