warning:C4201 pragma inline was not handled

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

warning:C4201 pragma inline was not handled

跳至解决方案
1,791 次查看
russellsher
Contributor III

I am using mcs908QE128 (on a demoqe board)

If I have:

#pragma inline

// Read the content of a memory address

char flash_read(unsigned int address)

{

  unsigned char *pointer;

  pointer = (char*) address;

  return (*pointer);

}

 

I get the warning above warning ( warning:C4201 pragma inline was not handled)

Does inlining not work for this device (or compiler)

thanks

Russell

 

标签 (1)
0 项奖励
回复
1 解答
1,352 次查看
CompilerGuru
NXP Employee
NXP Employee

Pragma's names are case sensitive, inline and INLINE is not the same. And in the answer above, I meant to mention that there is a pragma INLINE, I noticed I typed INTERRUPT instead.

Use (I did not try this out)

#pragma INLINE

// Read the content of a memory address

char flash_read(unsigned int address)

{

  const char *pointer;

  pointer = (const char*) address;

  return (*pointer);

}

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,352 次查看
CompilerGuru
NXP Employee
NXP Employee

That's exactly  what it means, the compiler does not recognize the inline pragma.

Note that the S08 compiler does know the pragma INTERRUPT (all uppercase).

Check the compiler manual for the s08 for a list of supported pragmas, it has a chapter "Compiler Pragmas".

Daniel

0 项奖励
回复
1,352 次查看
admin
Specialist II

Hi Daniel, I looked at the V10.x HC(S)08 Build Tools Reference Manual manual - it does list #pragma INLINE on page 360.

Is there another associated reason for the earning?

0 项奖励
回复
1,353 次查看
CompilerGuru
NXP Employee
NXP Employee

Pragma's names are case sensitive, inline and INLINE is not the same. And in the answer above, I meant to mention that there is a pragma INLINE, I noticed I typed INTERRUPT instead.

Use (I did not try this out)

#pragma INLINE

// Read the content of a memory address

char flash_read(unsigned int address)

{

  const char *pointer;

  pointer = (const char*) address;

  return (*pointer);

}

0 项奖励
回复
1,352 次查看
admin
Specialist II

Hi - thanks for that, I guess I didn't look too closely at the case

0 项奖励
回复
1,352 次查看
admin
Specialist II

many thanks for the reply - will check it out

0 项奖励
回复