Avoiding full path(s) in the output file

Technical Note 59374

Architectures:

All

Component:

general

Updated:

11/6/2015 1:53 PM

Introduction

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

Comments

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.

Suggestions

  • 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 :
--no_path_in_file_macros

Add it to "Project > Options > C/C++ Compiler > Extra Options".


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

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.