Subject:
|
Re: Declarations in header files
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 18 Apr 2001 17:50:05 GMT
|
Viewed:
|
1626 times
|
| |
| |
In article <GAuuG6.KJs@lugnet.com>, Jakob Engblom wrote:
> Hi!
>
> This is very technical, but:
>
> does the declaration of an
>
> "extern inline const void" function really make sense? GCC accepts it, but
> that is a VERY lenient compiler.
>
> An extern function should be definition not have a definition, and 'const void'
> gives a warning since const is not really applicable to void -- it lacks any
> meaning.
"extern inline" means that we are defining an inline function, but if
the inline function is not used, there is also an externally defined
function with the same purpose. So, if you compile without optimization,
it acts like "extern void f();", but if you compile with optimization,
it acts like "inline void f() { ... }".
Since there are in fact no definitions of these functions in .c files,
the use of "extern" is an error. The definitions should read
"inline void f(...) { ... }".
I'll check in a fix someday soon...
--matt
|
|
Message is in Reply To:
| | Declarations in header files
|
| Hi! This is very technical, but: does the declaration of an "extern inline const void" function really make sense? GCC accepts it, but that is a VERY lenient compiler. An extern function should be definition not have a definition, and 'const void' (...) (24 years ago, 27-Mar-01, to lugnet.robotics.rcx.legos)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|