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): gcc-4.0.0-9 How reproducible: Sometimes Steps to Reproduce: 1. Compile attached ipw2200.i file 2. 3. 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:
Created attachment 115189 [details] Preprocessed C file where I saw the problem first.
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); }
Tracking this upstream.