inline function

GNU Support GNUSupport@kpit.com
Fri Feb 28 09:49:00 GMT 2003


Dear Massimiliano,
Are you including the header file (which defines inline functions) in your source file ?
Please find attached zip file containing a sample program which uses your two inline functions.

The functions are working fine.
Regards,
GNU Support

-----Original Message-----
From: Massimiliano Cialdi [mailto:cialdi@firenze.net]
Sent: Thursday, February 27, 2003 8:36 PM
To: gnuh8@gnuh8.org.uk
Cc: gcc-help@gcc.gnu.org
Subject: inline function


I use gcc for h8300 from kpit.

in samples directory there is an example of inlined funcions.
I tried to inline two function in the same way.

in an header file there is:
__inline__ void ios_di(void) __attribute__ ((always_inline));
__inline__ void ios_ei(void) __attribute__ ((always_inline));

extern __inline__ void ios_di(void)
{
  asm ("orc.b #-128:8,ccr");
}
extern __inline__ void ios_ei(void)
{
  asm ("andc.b #127:8,ccr");
}                                         


I obtain no error in compilation, but when I link:

C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o: In function
`ios_init': C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:139:
undefined reference to `_ios_di'
C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:195: undefined
reference to `_ios_ei'
C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o: In function
`ios_semwait': C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:375:
undefined reference to `_ios_di'
C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:377: undefined
reference to `_ios_ei'

command lines are:
h8300-elf-gcc-wrapper.exe -c -x c -o
"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o"-g3
-Wa,-ahls="C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.lst"
-Wall

h8300-elf-ld-wrapper.exe -L
"c:\hew\tools\kpit\gnuh8-elf\v0301\h8300-elf\lib\gcc-lib\h8300-elf\3.2-
GNUH8_v0301\h8300s"-L "c:\hew\tools\kpit
gnuh8-elf\v0301\h8300-elf\h8300-elf\lib\h8300s"
-o"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\provegnuh8.x"
<Default>-Map
"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\provegnuh8.map"
-e_ios_init -( -l "m" -l "c" -l "gcc" -) 




Any idea?

-- 
Massimiliano Cialdi
cialdi@firenze.net
m.cialdi@oksys.it
cialdi@control.dsi.unifi.it

-- 
GNUH8 Mailing List | If you encounter difficulties using this service
                   | email: listmaster@gnuh8.org.uk
                   | http://www.gnuh8.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline.zip
Type: application/x-zip-compressed
Size: 35578 bytes
Desc: inline.zip
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20030228/2e582d50/attachment-0001.bin>


More information about the Gcc-help mailing list