<?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 does codewarrior support multiline macros with parameters? in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188570#M4646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i'm just making sure i can do multi line macros.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're using: "CodeWarrior Development Studio for ColdFire Architectures v6.3" and targeting this: "MCF52235 ColdFire Integrated Microcontroller"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So this is just an example of the type of macro i'm planning (My actual macro will contain 68K assembly, but this example is the same style i'll be using with the "\" and parameters):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define max(a,b) \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;({ typeof (a) _a = (a); \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;typeof (b) _b = (b); \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_a &amp;gt; _b ? _a : _b; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this ok?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Sep 2008 11:21:39 GMT</pubDate>
    <dc:creator>FocusedWolf</dc:creator>
    <dc:date>2008-09-26T11:21:39Z</dc:date>
    <item>
      <title>does codewarrior support multiline macros with parameters?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188570#M4646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i'm just making sure i can do multi line macros.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're using: "CodeWarrior Development Studio for ColdFire Architectures v6.3" and targeting this: "MCF52235 ColdFire Integrated Microcontroller"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So this is just an example of the type of macro i'm planning (My actual macro will contain 68K assembly, but this example is the same style i'll be using with the "\" and parameters):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define max(a,b) \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;({ typeof (a) _a = (a); \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;typeof (b) _b = (b); \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_a &amp;gt; _b ? _a : _b; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this ok?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 11:21:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188570#M4646</guid>
      <dc:creator>FocusedWolf</dc:creator>
      <dc:date>2008-09-26T11:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: does codewarrior support multiline macros with parameters?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188571#M4647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yes. With the exception of "typeof", that code is ISO C and must work on all standard compilers. Macros like that are on the other hand considered very poor programming, but that's another story.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 13:50:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188571#M4647</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-09-26T13:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: does codewarrior support multiline macros with parameters?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188572#M4648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;According to ColdFire_Build_Tools_Reference.pdf, typeof operator can be used only when GCC extension is enabled for&amp;nbsp;the compiler.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To enable GCC extension check "Enable GCC Extension in the target settings &amp;nbsp;"C/C++ Language" Panel.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I did try the macro you have provided with CodeWarrior for Coldfire V6.4 (I do not have a V6.3 installed any more) and it is working well.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 15:26:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188572#M4648</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-09-26T15:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: does codewarrior support multiline macros with parameters?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188573#M4649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Ok good. Anyways I have no need for that typeof stuff, that was just in an example i dug up to refresh my memory on how to write these things.&lt;BR /&gt;&lt;BR /&gt;And as far as "good" coding practices go, this is one of those times when macros seem like a good idea. my plan is to use them to implement certain 68K commands like CMP.B. Basically my code is bloated with workaround type code to do various byte level operations so one macro to do all, and not have to worry how the compare was implemented would be great.&lt;BR /&gt;&lt;BR /&gt;Message Edited by FocusedWolf on &lt;SPAN class="date_text"&gt;2008-09-27&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;07:49 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2008 13:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/does-codewarrior-support-multiline-macros-with-parameters/m-p/188573#M4649</guid>
      <dc:creator>FocusedWolf</dc:creator>
      <dc:date>2008-09-27T13:43:35Z</dc:date>
    </item>
  </channel>
</rss>

