At 11:15 AM 3/26/2004, you wrote:
hello guys,

I am using codewarrior v9.2 for palm now. I found some wierd things, not sure whether they are codewarrior's bugs:

Update to CodeWarrior for Palm OS V9.3.


1. sometimes after I changed my code, the first make will give me dozens of errors, but if I make it again, error numbers decrease dramatically;

This usually means either that some of those errors are warnings that didn't prevent a file from being built, or that you have an order problem and need to move your .rcp files to the top of the first segment to make sure they get built before the C/C++ source files.


2. If I put source code into more than one .c file, there will be link errors/warnings. For example, main source file is A; A calls some functions in B. I declared these functions in A.h. Both A and B include A.h:

in A.h:

void a(); //define function a()

You need to say


void a(void);

in C -- not putting a parameter declares the function as having an indefinite parameter list.

in A.c:

#include A.h

...//do something

a(); //call function a()

...//do something


in B.c:


#include A.h

void a(){

...//do something

}

Once I try to compile this project, there will be a link warning : function has no prototype. Sometimes it will warn me that function has been already defined.

Use the "preprocess" command to see exactly what you are compiling. It's possible that something is keeping your A.h header from expressing what you think it does. I do things like this all the time in CW without any issues.


-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/



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

Reply via email to