Page 1 of 1

Compiling under Windows 2003

PostPosted: Tue May 09, 2006 12:00 am
by richards
I tried an example that removed SALVO's macros from the equation.

The problem still existed - so we will pursue this with MicroChip and MicroSoft.



Re: Compiling under Windows 2003

PostPosted: Tue May 09, 2006 5:43 am
by richards
I am having problems with SALVO function calls when compiling with MCC18 under Windows 2003. Works OK under 2000/XP.

Here's an example.

The compiler returns: Syntax Error

To narrow the problem, I trid the following substitutions:
OS_Delay(500/OS_TICK, NULL); // WORKS
OS_Delay(OS_TICK , NULL); // Syntax Err
OS_Delay(500 , NULL); // WORKS

#defind Richard 500
OS_Delay(Richard, NULL); // Syntax Err

So the pattern so far - If the argument to OS_Delay is starts with a non-numeric character - I get the syntax error.

I've also gotten this with OS_ReadBinSem and OS_WaitBinSem.

Any assistance will be welcome.

Re: Compiling under Windows 2003

PostPosted: Tue May 09, 2006 7:38 am
by aek
What exactly is "Windows 2003"?

Are you running a Server version of Windows?

Regardless, I'm not sure how the Windows version would affect anything ... I would also advise against using NULL as a label.


Re: Compiling under Windows 2003

PostPosted: Tue May 09, 2006 9:32 am
by richards

Yes, 2003 is running on a server. The folks who do our official builds are converting their servers to WIN2003. During their trials, they encounted this problem.

I can get a clean build if I substitute MACRO calls with the corresponding in-line statements (I'll email some samples separately).

Like you, I'm at a loss to explain how MACRO expansion would be affected by the server's OS, unless the compiler uses some OS text processing library that is different in WIN2003.

FYI - I'm also running this past my MicroChip FAE for an opinion as well. (I'll let our server administrator deal with Microsoft!)

Thanks for your help.


Re: Compiling under Windows 2003

PostPosted: Tue May 09, 2006 9:51 am
by aek
Thanks for the feedback.

I would debug this by trying to reproduce the problem in a non-Salvo app, simply with a function that expects an argument of the same type as OS_Delay() (which is normally an 8-bit unsigned value).

What happens if you pass the "bad" macro to OSDelay(x)? Note that OSDelay() is a function (not normally used by the user), which is called via the macro OS_Delay().

Another way I debug this sort of thing is to look at the preprocessor output, though your error may in fact be pre-preprocessor.

Note that C has some rules regarding the first character of a defined constant -- I always avoid a numeric letter as the first character of a defined constant. My gut feeling is that the preprocessor is not seeing the OS_TICK symbol at all, or that the OS_TICK symbol somehow is either already predefined or is badly defined (bad character or something). Try #undefining OS_TICK before you #define it and see if something happens (or check if OS_TICK is already defined before you #define it).