Bug 159731 - Funnies with inclined functions in C
Funnies with inclined functions in C
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-06-07 11:38 EDT by Horst H. von Brand
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.0.1-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-12 09:37:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Preprocessed C file where I saw the problem first. (834.66 KB, text/plain)
2005-06-07 11:38 EDT, Horst H. von Brand
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 22441 None None None Never

  None (edit)
Description Horst H. von Brand 2005-06-07 11:38:26 EDT
Description of problem:
Compiling ipw2200 for my kernel I got unexplained error messages about
unavailable function bodies for inlined functions, I traced that to a function
that was defined twice, and differently.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Compile attached ipw2200.i file
Actual results:
/usr/src/ipw2200-1.0.4/ipw2200.c: In function ‘ipw_rx’:
/usr/src/ipw2200-1.0.4/net/ieee80211.h:722: sorry, unimplemented: inlining
failed in call to ‘is_multicast_ether_addr’: function body not available

Expected results:
Some comprehensible error message. This looks like the offending function isn't
defined, when the problem is that it is defined twice.

Additional info:
Comment 1 Horst H. von Brand 2005-06-07 11:38:27 EDT
Created attachment 115189 [details]
Preprocessed C file where I saw the problem first.
Comment 2 Horst H. von Brand 2005-06-07 11:42:26 EDT
I tried to cut it down to a small testcase, but there the compiler doesn't
complain at all! It seems to me it should either just error out if an inlined
function is being redefined, or (probably much harder) check somehow that the
bodies are the same before errorring out. Simplified test case follows (no way
to create another attachment, either when entering the bug or here).

typedef unsigned char u8;

static inline __attribute__((always_inline)) int is_multicast_ether_addr(const
u8 *addr)
 return addr[0] & 0x01;

int f(const u8 *addr)
  return !is_multicast_ether_addr(addr);

extern inline __attribute__((always_inline)) int is_multicast_ether_addr(const
u8 *addr)
 return ((addr[0] != 0xff) && (0x01 & addr[0]));

int g(const u8 *addr)
  return is_multicast_ether_addr(addr);
Comment 3 Jakub Jelinek 2005-07-12 09:37:55 EDT
Tracking this upstream.

Note You need to log in before you can comment on or make changes to this bug.