Bug 38754 - C99 and inline has a linker problem
Summary: C99 and inline has a linker problem
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-07 14:27 UTC by Andreas Klein
Modified: 2009-01-07 14:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Klein 2009-01-07 14:27:24 UTC
More a liker than compiler problem

When I compile the following programm with gcc -std=c99 I get a linker error.
When I compile it with gcc -O[23] -std=c99 it runs as expected.

For the case that the system matters: I am using Linux (Ubuntu 8.10)

inline void f() {
}

int main() {
  f();
}
Comment 1 Richard Biener 2009-01-07 14:36:58 UTC
You need an external definition of f.
Comment 2 Richard Biener 2009-01-07 14:38:22 UTC
See 6.7.4, especially the example in paragraph 7 and the explanation in 8.