[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?
From: |
Geoffrey Wossum |
Subject: |
Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's? |
Date: |
Thu, 30 Sep 2004 17:16:07 -0500 |
User-agent: |
KMail/1.7 |
On Thursday 30 September 2004 5:02 pm, Bill Somerville wrote:
>
> Declaring as static would make each non-inlined version local to the
> translation unit that generates it. I think this is already implied by
> the inline keyword.
Unless they changed the semantics in C99, inline does not imply static.
If you do
inline void somefunc(void) {}
in header file and include it in multiple compilation units, you will get
multiple definition errors upon trying to link them together. That's why you
need to do "static inline" or "extern inline".
Personally, I prefer "extern inline", because then you know you'll never get a
linkable version of the function generated in any object files. However,
I've read that "extern inline" is deprecated in GCC, and that "static inline"
should be used for new code. However, I think both glibc and the Linux
kernel use "extern inline" all over the place, so it's probably not going
away anytime soon.
---
Geoffrey Wossum
Long Range Systems - http://www.pager.net
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, (continued)
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, Theodore A. Roth, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, E. Weddington, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, Geoffrey Wossum, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, Theodore A. Roth, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, E. Weddington, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, Theodore A. Roth, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, E. Weddington, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?, Bill Somerville, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?, E. Weddington, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?, Bill Somerville, 2004/09/30
- Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?,
Geoffrey Wossum <=
RE: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?, Bernard Fouche, 2004/09/30
Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inlinefn's?, Bill Somerville, 2004/09/30
Re: [avr-libc-dev] Can pgmspace.h __LPM_xxx__ macros become inline fn's?, Theodore A. Roth, 2004/09/30