<?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 '__FILE__&amp;quot; Expansion should not include the path in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165615#M4822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using CodeWarrior v5.0 for the S12X, on Windows XP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the predefined "__FILE__" macro to build an ASSERT macro of my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that __FILE__ is replaced by the file name ***plus the file's entire path***.&amp;nbsp; This means that if I build my project in two different directories, I will have different load images (because the text contains the path).&amp;nbsp; This causes a lot of difficulty when different team members rebuild in different working directories, and get differing load images from the same exact source files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone discovered a way to suppress the path in the __FILE__ macro, so it expands to only the file name and extension?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jan 2010 06:06:54 GMT</pubDate>
    <dc:creator>davekellogg</dc:creator>
    <dc:date>2010-01-06T06:06:54Z</dc:date>
    <item>
      <title>'__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165615#M4822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using CodeWarrior v5.0 for the S12X, on Windows XP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the predefined "__FILE__" macro to build an ASSERT macro of my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that __FILE__ is replaced by the file name ***plus the file's entire path***.&amp;nbsp; This means that if I build my project in two different directories, I will have different load images (because the text contains the path).&amp;nbsp; This causes a lot of difficulty when different team members rebuild in different working directories, and get differing load images from the same exact source files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone discovered a way to suppress the path in the __FILE__ macro, so it expands to only the file name and extension?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 06:06:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165615#M4822</guid>
      <dc:creator>davekellogg</dc:creator>
      <dc:date>2010-01-06T06:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: '__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165616#M4823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to definition, __FILE__ returns the full path to the source file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Extract from Standard Predefined macro definition by GNU (&lt;A href="http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/Standard-Predefined-Macros.html" rel="nofollow" target="_blank"&gt;http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/Standard-Predefined-Macros.html):&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;DL&gt;&lt;DT&gt;__FILE__&lt;/DT&gt;&lt;DD&gt;This macro expands to the name of the current input file, in the form of a C string constant. This is the path by which the preprocessor opened the file, not the short name specified in #include or as the input file name argument. For example, "/usr/local/include/myheader.h" is a possible expansion of this macro."&lt;/DD&gt;&lt;DD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to remove the paths and keep only base file name, you need to get the file name in a string and format the string as you want to see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 23:08:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165616#M4823</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2010-01-06T23:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: '__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165617#M4824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;ISO C specifies __FILE__ as (ISO 9899:1999 6.10.8): "The presumed name of the current source file"&lt;BR /&gt;&lt;BR /&gt;Whether that includes the full path or not clear. There is however certainly nothing in the C standard enforcing a full path.&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 15:54:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165617#M4824</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2010-01-07T15:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: '__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165618#M4825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did some further googling, and found these points of interest.&amp;nbsp; Evidently, some versions of CW do (or once did) have a proagma "fullpath_file" for controlling how __FILE__ expands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Who at FreeScale should I contact for a feature change request to get this pragma into CodeWarrior for HCS12(X)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;+++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/CCOMPILERRM.pdf" target="test_blank"&gt;http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/CCOMPILERRM.pdf&lt;/A&gt;&lt;BR /&gt;CodeWarrior&amp;nbsp;Development&amp;nbsp;Tools&amp;nbsp;C&amp;nbsp;Compilers&amp;nbsp;Reference&amp;nbsp;3.2&amp;nbsp;(Dated&amp;nbsp;2004&amp;nbsp;July&amp;nbsp;06),&amp;nbsp;page&amp;nbsp;153&lt;BR /&gt;&lt;BR /&gt;Pragma:&amp;nbsp;fullpath_file&amp;nbsp;-&amp;nbsp;Controls&amp;nbsp;if&amp;nbsp;__FILE__&amp;nbsp;macro&amp;nbsp;returns&amp;nbsp;a&amp;nbsp;full&amp;nbsp;path&amp;nbsp;or&amp;nbsp;the&amp;nbsp;base&amp;nbsp;filename.&lt;BR /&gt;Syntax:&amp;nbsp;&amp;nbsp;#pragma&amp;nbsp;fullpath_file&amp;nbsp;on&amp;nbsp;|&amp;nbsp;off&amp;nbsp;|&amp;nbsp;reset&lt;BR /&gt;Targets:&amp;nbsp;All&amp;nbsp;platforms.&lt;BR /&gt;Remarks:&amp;nbsp;When&amp;nbsp;on,&amp;nbsp;the&amp;nbsp;__FILE__&amp;nbsp;macro&amp;nbsp;returns&amp;nbsp;a&amp;nbsp;full&amp;nbsp;path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;current&amp;nbsp;file,&amp;nbsp;otherwise&amp;nbsp;it&amp;nbsp;returns&amp;nbsp;the&amp;nbsp;base&amp;nbsp;filename.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;++++++++++++++++++++++&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/ColdFire_Build_Tools_Reference.pdf" target="test_blank"&gt;http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/ColdFire_Build_Tools_Reference.pdf&lt;/A&gt;&lt;BR /&gt;CodeWarrior&amp;nbsp;Development&amp;nbsp;Studio&amp;nbsp;ColdFire&amp;nbsp;Architectures&amp;nbsp;Edition&amp;nbsp;Build&amp;nbsp;Tools&amp;nbsp;Reference&amp;nbsp;&amp;nbsp;pg&amp;nbsp;308&amp;nbsp;(Revised&amp;nbsp;11&amp;nbsp;July&amp;nbsp;2006)&lt;BR /&gt;&lt;BR /&gt;Pragma:&amp;nbsp;fullpath_file&amp;nbsp;-&amp;nbsp;Controls&amp;nbsp;if&amp;nbsp;__FILE__&amp;nbsp;macro&amp;nbsp;returns&amp;nbsp;a&amp;nbsp;full&amp;nbsp;path&amp;nbsp;or&amp;nbsp;the&amp;nbsp;base&amp;nbsp;filename.&lt;BR /&gt;Syntax:&amp;nbsp;&amp;nbsp;#pragma&amp;nbsp;fullpath_file&amp;nbsp;on&amp;nbsp;|&amp;nbsp;off&amp;nbsp;|&amp;nbsp;reset&lt;BR /&gt;Targets:&amp;nbsp;All&amp;nbsp;platforms.&lt;BR /&gt;Remarks:&amp;nbsp;When&amp;nbsp;on,&amp;nbsp;the&amp;nbsp;__FILE__&amp;nbsp;macro&amp;nbsp;returns&amp;nbsp;a&amp;nbsp;full&amp;nbsp;path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;current&amp;nbsp;file,&amp;nbsp;otherwise&amp;nbsp;it&amp;nbsp;returns&amp;nbsp;the&amp;nbsp;base&amp;nbsp;filename.&lt;BR /&gt;&lt;BR /&gt;+++++++++++++++++++++++&lt;BR /&gt;&lt;A href="http://lists.apple.com/archives/Xcode-users/2005/Mar/msg00117.html" target="test_blank"&gt;http://lists.apple.com/archives/Xcode-users/2005/Mar/msg00117.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is&amp;nbsp;it&amp;nbsp;possible&amp;nbsp;to&amp;nbsp;get&amp;nbsp;gcc&amp;nbsp;to&amp;nbsp;output&amp;nbsp;just&amp;nbsp;the&amp;nbsp;source&amp;nbsp;file&amp;nbsp;name&amp;nbsp;for&amp;nbsp;__FILE__,&amp;nbsp;without&amp;nbsp;the&amp;nbsp;entire&amp;nbsp;absolute&amp;nbsp;path?&lt;BR /&gt;&amp;gt;e.g.&amp;nbsp;"foo.c"&amp;nbsp;instead&amp;nbsp;of&amp;nbsp;"Users/somebody/project/source/subfolder/&amp;nbsp;foo.c"?&lt;BR /&gt;&lt;BR /&gt;Comparing&amp;nbsp;some&amp;nbsp;large&amp;nbsp;source&amp;nbsp;trees&amp;nbsp;built&amp;nbsp;with&amp;nbsp;both&amp;nbsp;Codewarrior&amp;nbsp;and&amp;nbsp;gcc,&amp;nbsp;it&amp;nbsp;looks&amp;nbsp;like&amp;nbsp;CW&amp;nbsp;does&amp;nbsp;this,&amp;nbsp;but&amp;nbsp;I&amp;nbsp;don't&amp;nbsp;see&amp;nbsp;any&amp;nbsp;flag&amp;nbsp;to&amp;nbsp;make&amp;nbsp;gcc&amp;nbsp;do&amp;nbsp;it...&amp;nbsp;&lt;BR /&gt;GCC&amp;nbsp;uses&amp;nbsp;the&amp;nbsp;path&amp;nbsp;you&amp;nbsp;give&amp;nbsp;it.&amp;nbsp;So&amp;nbsp;if&amp;nbsp;you&amp;nbsp;tell&amp;nbsp;it&amp;nbsp;to&amp;nbsp;compile&amp;nbsp;foo.c,&amp;nbsp;__FILE__&amp;nbsp;will&amp;nbsp;be&amp;nbsp;foo.c,&amp;nbsp;but&amp;nbsp;if&amp;nbsp;you&amp;nbsp;tell&amp;nbsp;it&amp;nbsp;to&amp;nbsp;compile&amp;nbsp;/Users/somebody/&amp;nbsp;foo.c,&amp;nbsp;__FILE__&amp;nbsp;will&amp;nbsp;be&amp;nbsp;/Users/somebody/foo.c.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 23:37:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165618#M4825</guid>
      <dc:creator>davekellogg</dc:creator>
      <dc:date>2010-01-07T23:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: '__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165619#M4826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To ensure that your feature request gets recognized and looked at, you need to file a Service Request on that. Click &lt;A href="https://www.freescale.com/webapp/servicerequest.create_SR.framework" rel="nofollow" target="_self"&gt;here&lt;/A&gt; to file a service request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 21:42:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/165619#M4826</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2010-01-08T21:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: '__FILE__" Expansion should not include the path</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/1219990#M15524</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/25139"&gt;@davekellogg&lt;/a&gt;, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/4406"&gt;@J2MEJediMaster&lt;/a&gt; , &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/7049"&gt;@Lundin&lt;/a&gt; , &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/1415"&gt;@CrasyCat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is an old thread, but I wrote an article about how to tweak the __FILE__ macro on gcc not to include the path:&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2021/01/23/assert-__file__-path-and-other-cool-gnu-gcc-tricks-to-be-aware-of/" target="_self"&gt;assert(), __FILE__, Path and other cool GNU gcc Tricks to be aware of&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 06:26:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/FILE-quot-Expansion-should-not-include-the-path/m-p/1219990#M15524</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-01-24T06:26:31Z</dc:date>
    </item>
  </channel>
</rss>

