<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Compiler Error C141</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/28022/compiler-error-c141</link><description> 
I am getting compiler error for below given function written to
read the MAC (IEEE) address of TI CC2430 

 
 ( error C141: syntax error near &amp;#39;code&amp;#39; ... &amp;amp; ... error
C141: syntax error near &amp;#39;)&amp;#39; ) 

 
 // // Keil workaround
#define __code code;

//IEEE</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/136554?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2011 07:21:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ed7a041a-477a-4f20-ab90-611c39273bd0</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Why do you call it a &amp;quot;workaround&amp;quot; &lt;b&gt;?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
Surely, it&amp;#39;s just a matter of correct syntax - no &amp;quot;workaround&amp;quot;
?!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/126984?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2011 07:13:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e82f6a72-ee8e-4707-8b73-e086b38fa4e9</guid><dc:creator>AD D</dc:creator><description>&lt;p&gt;&lt;p&gt;
the workaround is&lt;/p&gt;

&lt;pre&gt;

flash = (uint8_t code*)(MAC_FLASH_ADDR);

&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/119381?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2011 12:06:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dacfab97-8d8e-4eb7-af6d-cf0a1f0462dc</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;pre&gt;
&lt;i&gt;// // Keil workaround&lt;/i&gt;
&lt;/pre&gt;

&lt;p&gt;
That hints at this being an attempt to move code from one compiler
to the other without really understanding the particularities of
either. And that&amp;#39;s exactly where your code fails. The pointer cast is
syntacically incorrect. Get back to the documentation and find out
how to spell memory-space specific pointer types in Keil.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/105093?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2011 05:49:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:198a57c2-db43-4674-8136-57fc4b4fe350</guid><dc:creator>AD D</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry, I think by mistake I added the semicolon. There is no
semicolon.&lt;/p&gt;

&lt;pre&gt;

// // Keil workaround
#define __code   code

//IEEE MAC address in flash memory
#define MAC_FLASH_ADDR (0x3FFFF-7)


uint8_t IEEE_MAC[8];

void ReadMAC(void)
{
  bspIState_t state;
  uint8_t fmaptmp;
  uint8_t i;
  uint8_t code *flash;
  BSP_ENTER_CRITICAL_SECTION(state);
  while (FCTL &amp;amp; BIT7); //wait for the flash controller to be ready
  fmaptmp = FMAP;
  FMAP = MAC_FLASH_ADDR &amp;gt;&amp;gt; 15;
  flash = (code uint8_t *)((MAC_FLASH_ADDR &amp;amp; 0xFFFF) | 0x8000);  Compiler Error
  for(i=0; i&amp;lt;8; i++)
  {
    IEEE_MAC[i] = flash[7-i];
  }
  FMAP = fmaptmp;
  BSP_EXIT_CRITICAL_SECTION(state);
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/91111?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2011 14:56:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d614a1d7-702a-4368-94f0-582dfc733bdf</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
See: &lt;a href="http://www.8052.com/forum/read/29152"&gt;www.8052.com/.../29152&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error C141</title><link>https://community.arm.com/thread/59645?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2011 14:33:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0ab4c4e5-4ada-45bd-a09c-424318f75844</guid><dc:creator>ashley madison</dc:creator><description>&lt;p&gt;&lt;pre&gt;
#define __code   code;
&lt;/pre&gt;

&lt;p&gt;
Delete the semicolon.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>