Why do I get error C3201 here?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why do I get error C3201 here?

965 Views
checkers
Contributor III

I added one line to a function and now I get an error C3201

 

Here is the code. I added the last line in this list

 

/* ************************************************************ */

void simulate_stick(unsigned char arrow_state) {

  setLedArrow5(arrow_state && 0x01);

  arrow_state = arrow_state / 2; // throws a C3201 error

  ...

/* ************************************************************ */

void simulate_stick(unsigned char arrow_state) {


Now, I am editing all code inside of the CodeWarrior IDE.

I don't have UNIX - this is a Windows 7 PC.

 

Where did that error come from?

What can I do to eliminate the error?

Labels (1)
0 Kudos
Reply
3 Replies

584 Views
CrasyCat
Specialist III

Hello

I would try the following:

  • Open the source file in an editor window
  • In the editor window click on the Document settings icon (the 4th starting from left).
  • Select DOS

pastedImage_0.png

  • Once this is done press CTRL + S or select File > Save
  • Try to rebuild.

CrasyCat

0 Kudos
Reply

584 Views
checkers
Contributor III

Apparently, if I compile three times in sequence without making any changes to the code, the error goes away.

However, it comes back as soon as I change the code and try to re-compile. Then I have to repeat two more times to get the error to go away.

This is definitly a bug in the IDE.

How should it be reported?

0 Kudos
Reply

584 Views
checkers
Contributor III

Alright, I have the root cause.

I must have leaned on the shift key when I pressed return at the end of that line, then I added the ;

<shift><return> adds a <cr> character without the <lf> character. It is called a soft return in the printing industry.

Running make a couple of times in a row must have temporarily removed the lone <cr> and placed a <cr><lf> at the end of the line.

So, it is still a bug which should be prevented, or you could change the documentation to show this possibility.

0 Kudos
Reply