<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [ColdFire] array of pointers to constant objects? in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/ColdFire-array-of-pointers-to-constant-objects/m-p/166572#M3065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like my "data" variable to be an array of pointers pointing to the values I specify (which are constant and known at compile time).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In GCC it looks something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const void* const data[] = { 0x01, "foo", 0x02, "bar" };&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't work in CodeWarrior, any help / hints would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Nov 2007 02:31:32 GMT</pubDate>
    <dc:creator>KRichard</dc:creator>
    <dc:date>2007-11-24T02:31:32Z</dc:date>
    <item>
      <title>[ColdFire] array of pointers to constant objects?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/ColdFire-array-of-pointers-to-constant-objects/m-p/166572#M3065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like my "data" variable to be an array of pointers pointing to the values I specify (which are constant and known at compile time).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In GCC it looks something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const void* const data[] = { 0x01, "foo", 0x02, "bar" };&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't work in CodeWarrior, any help / hints would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Nov 2007 02:31:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/ColdFire-array-of-pointers-to-constant-objects/m-p/166572#M3065</guid>
      <dc:creator>KRichard</dc:creator>
      <dc:date>2007-11-24T02:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: [ColdFire] array of pointers to constant objects?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/ColdFire-array-of-pointers-to-constant-objects/m-p/166573#M3066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;did you try to cast the int's to (void*).&lt;BR /&gt;I don't think it is legal to assign (implicitly convert) any integer besides 0, so I would try to cast the 0x01.&lt;BR /&gt;So I would try something like (not compiled on my own):&lt;BR /&gt;const void* const data[] = { (const void*)0x01, "foo", (const void*)0x02, "bar" };&lt;BR /&gt;&lt;BR /&gt;Or, depending on your needs, may not aply in your setup:&lt;BR /&gt;struct elem { int val, void* ptr};&lt;BR /&gt;const struct elem data[]= { {0x01, "foo"}, {0x02,"bar"}};&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2007 17:11:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/ColdFire-array-of-pointers-to-constant-objects/m-p/166573#M3066</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-11-26T17:11:44Z</dc:date>
    </item>
  </channel>
</rss>

