<?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 Re: &amp;quot;Require Function Prototypes&amp;quot; option in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206359#M9818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, I totally agree with you! And I'm also used to work with it but I could find that option in CF v1 MCUs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SebaS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2012 12:08:40 GMT</pubDate>
    <dc:creator>sebasira</dc:creator>
    <dc:date>2012-12-14T12:08:40Z</dc:date>
    <item>
      <title>"Require Function Prototypes" option</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206355#M9814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to you all!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't know where to put this question, I guess here is the best place. I'm working with MCF51QE and CW v6.1 and I was breaking my head looking to "&lt;SPAN style="color: #51626f; font-family: arial, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;Warning C1801: implicit parameter-declaration." until I discover the "Require Function Prototypes" option in the C/C++ Language panel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking for it, since sometimes I was getting a strange behavior of the firmware, and I was guessing is was due to "&lt;SPAN style="color: #51626f; font-family: arial, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;implicit parameter-declaration&lt;/SPAN&gt;" on some function calls, but I didn't know where.&lt;/P&gt;&lt;P&gt;Now I've check that option and I've found lots (more than 50) of function calls without prototype (#include directive).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering why this option is not "ON" by default and what does the compiler do when the function prototype is missing? From my experience, I can tell that sometimes (maybe always) when the function prototype was missing, the MCU does "&lt;EM&gt;what it wants"&lt;/EM&gt; when it reach that statement or just ignores it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can inlightme or clarify my mind.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sebastian M. Irazabal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 18:33:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206355#M9814</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-12-12T18:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: "Require Function Prototypes" option</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206356#M9815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a function for which you do not have a prototype is fully legal in ANSI C. This is t reason the option require prototype is not activated by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a standard ANSI C behavior. If the compiler does not find a prototype for a function it will make assumptions on the type of the parameters passed to the function.&lt;/P&gt;&lt;P&gt;So if you are lucky the application will work as expected, but you may be facing some issues is parameters are passed and read in two different ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically for numerical value, the compiler assumes that all parameters are of type int when no prototype is detected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 15:26:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206356#M9815</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-12-13T15:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: "Require Function Prototypes" option</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206357#M9816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, CasyCat!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 15:28:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206357#M9816</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-12-13T15:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: "Require Function Prototypes" option</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206358#M9817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; This is a standard ANSI C behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a cause of so many bugs that most code shops and programmers won't write code without prototypes. Whenever I come across code like this I feel I'm driving a car without a seatbelt or a bike without a helmet. Or Brakes, frankly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just turn the compiler option on to consider "missing prototypes" to be a fatal error and then fix the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 00:01:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206358#M9817</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2012-12-14T00:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: "Require Function Prototypes" option</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206359#M9818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, I totally agree with you! And I'm also used to work with it but I could find that option in CF v1 MCUs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SebaS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 12:08:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/quot-Require-Function-Prototypes-quot-option/m-p/206359#M9818</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-12-14T12:08:40Z</dc:date>
    </item>
  </channel>
</rss>

