+++ This bug was initially created as a clone of Bug #722942 +++ Description of problem: The problem is that readline shouldn't be defining isxdigit as a macro ever. That is wrong in C++ because it is a template function. If you look at ctype.h you see the correct declaration which is excluded from C++ with: #if !defined __NO_CTYPE && !defined __cplusplus <snip> # define isxdigit(c) __isctype((c), _ISxdigit) This is a bug in readline. Version-Release number of selected component (if applicable): CURRENTRELEASE How reproducible: 100% Steps to Reproduce: $ cat test.C #include <string> #include <readline/readline.h> #include <iostream> using namespace std; int main() { cout<<"Hi There "<<isxdigit(19)<<endl; return 0; } $ g++ test.C Actual results: (lin numbers/versions different between RHEL 6 and Fedora but result should be same) In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ios:47, from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ostream:44, from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iostream:44, from test.C:3: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/localefwd.h:90:35: error: macro "isxdigit" passed 2 arguments, but takes just 1 In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_ios.h:44, from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ios:50, from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ostream:44, from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iostream:44, from test.C:3: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/locale_facets.h:4609:45: error: macro "isxdigit" passed 2 arguments, but takes just 1 /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/localefwd.h:90: error: 'std::isxdigit' declared as an 'inline' variable /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/localefwd.h:90: error: template declaration of 'bool std::isxdigit' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/locale_facets.h:4609: error: invalid function declaration Expected results: No garbage. Additional info: A simple fix in readline would be to add !defined __cplusplus to the declaration in chardefs.h 75 #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) 76 # define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) 77 #endif so that line 75 ends up being: 75 #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus) 76 # define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) 77 #endif
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
fixed commited to git -> http://lists.fedoraproject.org/pipermail/scm-commits/2011-August/654445.html -> closed