Taking RISC-V to the next level!

IAR Embedded Workbench for RISC-V now released

Tools for Risc-V

Avoiding full path(s) in the output file

Technical Note 59374



10/9/2015 7:44 AM


The output file contain full paths to source files. This is not wanted behaviour.


The typical reason for this problem is that the application uses the assert macro which in turn uses the macro __FILE__ which expands to the full path of the current file.


  • Avoid Assert - By using conditional compilation, assert-messages can be avoided.
    The file "\arm\inc\c\assert.h" uses this construction to avoid assert-messages to be built into the output file/image:
  •  #ifdef NDEBUG
    #define assert(test) ((void)0)
  • Exclude path in macros - This can be done by using the command line option :
    Add it to "Project > Options > C/C++ Compiler > Extra Options".

All product names are trademarks or registered trademarks of their respective owners.

Related Tech Notes

© IAR Systems 1995-2019 - All rights reserved.

We use cookies on this website to provide you with a better experience. You need to accept cookies to continue using this site. Cookies