Why do I get error C3201 here?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why do I get error C3201 here?

1,106件の閲覧回数
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?

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

725件の閲覧回数
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 件の賞賛
返信

725件の閲覧回数
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 件の賞賛
返信

725件の閲覧回数
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 件の賞賛
返信