On Thu, 25 Sep 2014 23:29:03 +0200
Philipp Klaus Krause <p...@spth.de> wrote:

> On 25.09.2014 21:13, Alan Cox wrote:
> > Is there a "proper" way to put some functions in a file into a different
> > section for linking
> > 
> > Right now I'm doing
> > 
> > /* Force the rest of this code into common */
> > 
> > void dummy(void) __naked
> > {
> > __asm
> >   .area _COMMONMEM
> > __endasm;
> > }
> > 
> > which while bletcherous does seem to work, at least for my use case.
> 
> 
> Why can't you put those functions that need to go to different sections
> into different files? That should make things easier.

Because
- its two pieces of code that need to be modified together so splitting
  them up is going to result in hard to find bugs when they get out of
  sync

- it would mean making a lot of static variables global

In the gcc world I can do this and it's quite useful. I can however fold
the sdcc hack into a macro and hide it if need be thanks to sdcc having a
decent C preprocessor.

Alan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to