#1888 problem with inline keywords.

open
nobody
PIC16
5
2015-02-18
2011-12-09
mancausoft
No

I try to use it:

inline void spi_send(unsigned char cmd)
{
SSPBUF = cmd;
while(!SSPSTATbits.BF);
}

but compile failed:
sdcc --std-sdcc99 --use-non-free main.c -mpic16 -p18f46k22
main.asm:19:Error [113] Symbol not previously defined (_spi_send).

I read main.asm:
;--------------------------------------------------------
; public variables in this module
;--------------------------------------------------------
global _spi_init
global _spi_send
global _main

O.o global _spi_send, it's a bug. It's a inline function, it dosen't exists in asm.

Discussion

  • mancausoft

    mancausoft - 2011-12-10

    bug fix

     
  • mancausoft

    mancausoft - 2011-12-10

    I fixed it. Attached patch inline-bug.patch. It's work for me.

     
  • Ben Shi

    Ben Shi - 2015-02-18
    • Category: --> PIC16
     

Log in to post a comment.