Apologies, it just occurred to me that I neglected to mention the switches
I'm using:

sdcc --asm=<path to GPASM> -c -mpic16 -p18f4620 --fommit-frame-pointer
--optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I<bunch
of include paths and defines> clk.c -o _output/clk.o

I tried it unsuccessfully without the optimisers on too. I don't suppose any
of that's relevant, but I thought it worth a mention anyway. 

Thanks again!

-----Original Message-----
From: stryd one [mailto:[EMAIL PROTECTED] 
Sent: Friday, 4 July 2008 10:50 AM
To: sdcc-user@lists.sourceforge.net
Subject: Inline functions

Hi list,

I hope you can help me with this, I've read the mail archives, forums,
website and pdf doc, experimented like crazy, and I just cannot get inline
functions to compile.
>From what I gather, others don't have this same problem, so maybe it's just
my syntax... I'm still new to C I guess.. 

This:
unsigned char f1(unsigned char x) {  return x + 6; }

Compiles fine......

This:
inline unsigned char f1(unsigned char x) {  return x + 6; }

Returns this:
main.c:34: syntax error: token -> 'unsigned' ; column 15

Essentially, whatever I put after the inline keyword, generates a syntax
error. I tried with SDCC 2.7, 2.8, and a few recent nightlies and an older
one from april, all the same... Tried using the -std-c99 switch and still
the same... Tried a few different ways to declare/define the function, no
joy... Am I doing something wrong? I know that this is 'alpha' but from what
I gather, it at least compiles for others. I could use macros, but I'd
rather not, if I can help it.

Thanks in advance for any help you can give (and for the good tips I've
picked up from this list in the past!)

stryd_one 


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to