<?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 C23000: Argument(s) too complex for function pointer call in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169309#M5121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have NEVER seen this error and haven't a clue how to fix it at the moment. I was writting a simple multithreading core for our RS08-based board, and it suddenly started throwing this error. I've tried simple things like rebooting, etc, to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In threading.h&lt;/P&gt;&lt;PRE&gt;
typedef struct {&amp;nbsp; unsigned short lc;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // current line of the thread&amp;nbsp; unsigned char rc;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // return condition&amp;nbsp; char (*fn)(struct __thread *pt); // pointer to the function} __thread;&lt;/PRE&gt;&lt;P&gt;Then in main.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
extern char ISR_RTI(__thread *pt);//...static __thread thread[] = {&amp;nbsp; { 0, 0, ISR_RTI },&amp;nbsp; // real-timer interrupt handler
&amp;nbsp; //...};void main(void) {&amp;nbsp; static unsigned char current_thread;&amp;nbsp; //...&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;thread[current_thread].rc = thread[current_thread].fn(&amp;amp;thread[current_thread]);&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;Red indicates the line the error happens on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;The funny thing is that it was compiling at one point. I know I changed something and lost track of what I changed and can't seem to get it back into a working state. Any help would be greatly appreciated. Thanks in advance!&lt;/SPAN&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by nonarKitten on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-04-02&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:50 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:17:16 GMT</pubDate>
    <dc:creator>nonarKitten</dc:creator>
    <dc:date>2020-10-29T09:17:16Z</dc:date>
    <item>
      <title>C23000: Argument(s) too complex for function pointer call</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169309#M5121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have NEVER seen this error and haven't a clue how to fix it at the moment. I was writting a simple multithreading core for our RS08-based board, and it suddenly started throwing this error. I've tried simple things like rebooting, etc, to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In threading.h&lt;/P&gt;&lt;PRE&gt;
typedef struct {&amp;nbsp; unsigned short lc;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // current line of the thread&amp;nbsp; unsigned char rc;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // return condition&amp;nbsp; char (*fn)(struct __thread *pt); // pointer to the function} __thread;&lt;/PRE&gt;&lt;P&gt;Then in main.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
extern char ISR_RTI(__thread *pt);//...static __thread thread[] = {&amp;nbsp; { 0, 0, ISR_RTI },&amp;nbsp; // real-timer interrupt handler
&amp;nbsp; //...};void main(void) {&amp;nbsp; static unsigned char current_thread;&amp;nbsp; //...&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;thread[current_thread].rc = thread[current_thread].fn(&amp;amp;thread[current_thread]);&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;Red indicates the line the error happens on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;The funny thing is that it was compiling at one point. I know I changed something and lost track of what I changed and can't seem to get it back into a working state. Any help would be greatly appreciated. Thanks in advance!&lt;/SPAN&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by nonarKitten on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-04-02&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:50 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:17:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169309#M5121</guid>
      <dc:creator>nonarKitten</dc:creator>
      <dc:date>2020-10-29T09:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: C23000: Argument(s) too complex for function pointer call</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169310#M5122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Multi threading with a RS08? Interesting.&lt;/P&gt;&lt;P&gt;As the RS08 does not have a stack, the compiler allows to pass only 8 bit arguments (in A)&lt;/P&gt;&lt;P&gt;via function pointers.&lt;/P&gt;&lt;P&gt;Could it be that the pt argument was added? Or could it be that the memory model has changed?&lt;/P&gt;&lt;P&gt;In one memory model (don't even remember the name, but the one I would use usually) plain pointers&lt;/P&gt;&lt;P&gt;are 8 bits. In the other one, they are 16 bits and a single pointer argument would therefore not&lt;/P&gt;&lt;P&gt;be possible with a function pointer call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 09:49:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169310#M5122</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-04-03T09:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: C23000: Argument(s) too complex for function pointer call</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169311#M5123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;typedef struct {&lt;BR /&gt;unsigned short lc; // current line of the thread&lt;BR /&gt;unsigned char rc; // return condition&lt;BR /&gt;char (*fn)(struct __thread *pt); // pointer to the function&lt;BR /&gt;} __thread;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just a wild guess:&lt;BR /&gt;&lt;BR /&gt;You had something like this, but it wouldn't work because of linkage:&lt;BR /&gt;&lt;BR /&gt;char (*fn)(__thread *pt);&lt;BR /&gt;&lt;BR /&gt;The __thread identifier is unknown at that point. So maybe you changed to struct?&lt;BR /&gt;Try this and see if it solves anything:&lt;BR /&gt;&lt;BR /&gt;typedef struct __thr {&lt;BR /&gt;unsigned short lc; // current line of the thread&lt;BR /&gt;unsigned char rc; // return condition&lt;BR /&gt;char (*fn)(struct __thr *pt); // pointer to the function&lt;BR /&gt;} __thread;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another guess: meddling with the memory sizes would make function pointers a different width. You could try this non-standard code and see if it helps:&lt;BR /&gt;&lt;BR /&gt;char (* near fn)(struct __thr *pt)&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 16:54:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C23000-Argument-s-too-complex-for-function-pointer-call/m-p/169311#M5123</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-04-03T16:54:12Z</dc:date>
    </item>
  </channel>
</rss>

