Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 159731 - Funnies with inclined functions in C
Summary: Funnies with inclined functions in C
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-07 15:38 UTC by Horst H. von Brand
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.0.1-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-07-12 13:37:55 UTC
Type: ---

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

System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 22441 0 None None None Never

Description Horst H. von Brand 2005-06-07 15:38:26 UTC
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 15:38:27 UTC
Created attachment 115189 [details]
Preprocessed C file where I saw the problem first.

Comment 2 Horst H. von Brand 2005-06-07 15:42:26 UTC
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 13:37:55 UTC
Tracking this upstream.

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