This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 3.3 problem: <ctype.h> and <iostream>


Craig Rodrigues wrote:
Hi,

I just did a contrib/gcc_update in my CVS tree on the 3.3 branch
and am now encountering a new problem.

If I have the following file:

#include <ctype.h>
#include <iostream>
#include <ios>

...
Compiling it yields the following error on RedHat Linux 7.2 system:

...

If I change the order of the  includes to:

#include <iostream>
#include <ios>
#include <ctype.h>

Then the error goes away.

What's going on here?
What's most likely going on is that <ctype.h> #defines isspace()
et al and the macros interfere with the templates brought in from
<locale>. FWIW, because it's such a common problem, we ended up parenthesizing all references to isspace() and friends to avoid
these errors.

Regards
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]