This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch] Fix filebuf_virtuals.cc for unsigned char platforms
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, jeroen dot dobbelaere at acunia dot com, mark at wildebeest dot org
- Date: Thu, 06 Feb 2003 23:36:55 +0100
- Subject: [Patch] Fix filebuf_virtuals.cc for unsigned char platforms
Hi,
currently this test is failing on mips, arm and powerpc: all
unsigned char platforms. Honestly, I'm not 100% sure but the
testcase I blindly copied from libstdc++/9538 seems weak wrt
char signedness.
Kaveh, Jeroen, Mark, could you possibly test the below on your
favourite unsigned char platform and report?
Thanks!
Paolo.
///////////
2003-02-06 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/filebuf_virtuals.cc (test08): Fix for
unsigned char platforms.
--- filebuf_virtuals.cc.~1.10.~ 2003-02-04 23:42:32.000000000 +0100
+++ filebuf_virtuals.cc 2003-02-06 23:18:08.000000000 +0100
@@ -542,8 +542,8 @@
public:
static bool eq(char c1, char c2)
{
- VERIFY( c1 >= 0 );
- VERIFY( c2 >= 0 );
+ VERIFY( c1 != 'X' );
+ VERIFY( c2 != 'X' );
return std::char_traits<char>::eq(c1, c2);
}
};
@@ -555,8 +555,8 @@
public:
MyBuf()
{
- std::memset(buffer, -1, sizeof(buffer));
- std::memset(buffer + 2, 0, 4);
+ std::memset(buffer, 'X', sizeof(buffer));
+ std::memset(buffer + 2, 'f', 4);
setg(buffer + 2, buffer + 2, buffer + 6);
}
};
@@ -567,7 +567,7 @@
bool test = true;
MyBuf mb;
- mb.sputbackc(0);
+ mb.sputbackc('a');
}
// libstdc++/9439, libstdc++/9425