<bitset> problem

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Mon May 31 21:06:00 GMT 1999


> I wanted to read a .class and transfom its contents
> into readable characters when I ran into this.

Thanks for your bug report. gcc-2.95 19990523 reports

classfile.h:10: syntax error before `;'

so it appears that this bug has been fixed. The problem is that the
compiler doesn't know what std::bitset is, which is fixed by adding

#include <bitset>

at the top of classfile.h. Unfortunately, this leads to the next error
in the compiler version above: The compiler now complains

classfile.h: In instantiation of `bitset<8,long unsigned int>':
classfile.h:11:   instantiated from here
classfile.h:11: `CHAR_BIT' was not declared in this scope
classfile.h:11: `CHAR_BIT' was not declared in this scope

This is a bug in the standard header <bitset>: Apparently, an include
of <limits.h> is missing in that header. Adding both headers fixes the
problem.

Regards,
Martin



More information about the Gcc-bugs mailing list