------- Comment #3 from rguenth at gcc dot gnu dot org 2009-12-20 13:11 ------- Works for me. The preprocessed source is certainly not what was compiled (I assume the linkage specification of btowc was actually different).
Working testcase, robustened against -std=c99: extern int __btowc_alias (int __c) __asm ("btowc"); extern __inline int __attribute__ ((__nothrow__,gnu_inline)) btowc (int __c) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? __c : __btowc_alias (__c)); } int main() { btowc (-1); return 0; } In reply to comment #2 - this is a standard technique used in glibc. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WORKSFORME http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440