Skip to main content
Visitor II
October 10, 2016
Question

Cosmic, compile without unused code

  • October 10, 2016
  • 2 replies
  • 859 views
Posted on October 10, 2016 at 15:13

Hi,

I made a primitive program that calls few functions of Standard Peripheral Library / CLK and GPI modules, so source files  stm8s_clk.c + stm8s_gpio.c were added to project.

After compilation I checked .map file and found that code contains ALL functions of these modules, despite most of them are never called.

What needs to be done in order to not compile unused functions ?

    This topic has been closed for replies.

    2 replies

    Visitor II
    October 13, 2016
    Posted on October 13, 2016 at 08:38

    Hi !

    Just try +split compiler flag...

    Visitor II
    October 17, 2016
    Posted on October 17, 2016 at 11:13

    Thanks HaJo, it does what I needed.