This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: egcs-19981208 and libg++-2.8.1.2a-19981114


On Wed, 9 December 1998, 19:49:27, doko@cs.tu-berlin.de wrote:

 > This snapshot from CVS fails to build the most recent libg++ on a
 > Linux glibc2.0.7 ix65 system:
 > 
 [snip]
 >   /export/swt-dev/users/doko/egcs/egcs-snapshot-19981208/builddir/gcc/xgcc -B/export/swt-dev/users/doko/egcs/egcs-snapshot-19981208/builddir/gcc/ -B/usr/lib/egcs-ss/i486-linux/bin/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -nostdinc++ -I. -I../../libio -I../../../../libg++/src -I../../../../libg++/src/../../libio -I../../../../libg++/src/../../libstdc++ -I../../../../libg++/src/../src    -fpic ../../../../libg++/src/Regex.cc -o pic/Regex.o
 > ../../../../libg++/src/Regex.cc: In method `Regex::Regex(const char *, int = 0, int = 40, const char * = 0)':
 > ../../../../libg++/src/Regex.cc:68: assignment to `char *' from `unsigned char *' changes signedness
 > ../../../../libg++/src/Regex.cc:72: assignment to `unsigned char *' from `char *' changes signedness
 > make[4]: *** [Regex.o] Error 1

Please use the patch below; I'll release an updated libg++ including this and
other patches soon.

manfred


1998-12-09  Manfred Hollstein  <manfred@s-direktnet.de>

	* ADT-examples/keyhash.cc (Lookup_Table::operator ()): Declare return
	type explicitly.

1998-12-09  Manfred Hollstein  <manfred@s-direktnet.de>

	* Regex.cc (Regex::Regex): Use "typeof" for casting various pointers
	to avoid glibc related signed/unsigned problems.

diff -rupN libg++-2.8.1.2a-19981114/libg++/etc/ADT-examples/keyhash.cc libg++-2.8.1.2a-19981209/libg++/etc/ADT-examples/keyhash.cc
--- libg++-2.8.1.2a-19981114/libg++/etc/ADT-examples/keyhash.cc	Sat Mar 11 20:42:32 1995
+++ libg++-2.8.1.2a-19981209/libg++/etc/ADT-examples/keyhash.cc	Wed Dec  9 14:40:26 1998
@@ -97,7 +97,7 @@ public:
   int  operator () (char *Str,int Len);
 };
 
-Lookup_Table::operator () (char *Str,int Len)
+int Lookup_Table::operator () (char *Str,int Len)
 {
   if (Len <= MAX_WORD_SIZE && Len >= MIN_WORD_SIZE)
     {
diff -rupN libg++-2.8.1.2a-19981114/libg++/src/Regex.cc libg++-2.8.1.2a-19981209/libg++/src/Regex.cc
--- libg++-2.8.1.2a-19981114/libg++/src/Regex.cc	Sun Nov 24 10:16:52 1996
+++ libg++-2.8.1.2a-19981209/libg++/src/Regex.cc	Wed Dec  9 14:50:23 1998
@@ -65,11 +65,11 @@ Regex::Regex(const char* t, int fast, in
     buf->fastmap = (char*)malloc(256);
   else
     buf->fastmap = 0;
-  buf->translate = (unsigned char*)transtable;
+  buf->translate = (__typeof__ (buf->translate)) transtable;
   if (tlen > bufsize)
     bufsize = tlen;
   buf->allocated = bufsize;
-  buf->buffer = (char *)malloc(buf->allocated);
+  buf->buffer = (__typeof__ (buf->buffer)) malloc (buf->allocated);
   const char* msg = re_compile_pattern((const char*)t, tlen, buf);
   if (msg != 0)
     (*lib_error_handler)("Regex", msg);


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