Loading ...
Sorry, an error occurred while loading the content.
 

"-include" on gcc command line can be tricky

Expand Messages
  • Jefferson Smith
    Since not much trafic here, I ll throw out a problem. Note: I already found the cause and can work around this, but have not found a way to use -include in
    Message 1 of 1 , Mar 1, 2007
      Since not much trafic here, I'll throw out a problem.

      Note: I already found the cause and can work around this, but have not
      found a way to use "-include" in my particular situation. Perhaps it
      is not practical.

      I use a third-party C header in FreeRTOS (portable.h), which normally
      would provide this conditional line to enable my port:
      #include "../../Source/portable/GCC/HCS12/portmacro.h"

      but since I had not yet given them the port I created, that line did
      not exist. I wanted to make my demo app without adding that, to
      preserve their files so I'm not confused with version control stuff. I
      used "-include" on the gcc command line (by editing my Makefile).

      It was compiling as expected, and showed no problem so I thought it
      worked. The problem is that the prj ran differently (crashed). It
      turned out that "-include" works *before* any other inclusions in the
      source, which I sort of knew, but then I realized my "portmacro.h"
      does depend on two other symbols to control definitions (using #if...).

      I thought, "swell, I'll just define configUSE_16_BIT_TICKS and
      BANKED_MODEL also on command line", but no, of course that created a
      problem. Those two are defined in headers, and therefore cause an
      error: already defined. Hmmm... I don't see how I can do it without
      changing either the vendor's "portable.h" or my "portmacros.h", yet I
      wanted to preserve "portmacros.h" also because I should test it
      exactly as is it will be.

      So unless anyone has good ideas how I could still use "-include", I'll
      go with creating a branch (using Subversion) to modify FreeRTOS's
      "portable.h", but only merge to trunk from vendor releases.
    Your message has been successfully submitted and would be delivered to recipients shortly.