PATCH: Fix libgomp compile failure on Tru64 UNIX V5.1B

Rainer Orth ro@techfak.uni-bielefeld.de
Mon Jun 16 15:46:00 GMT 2008


libgomp fails to compile on alpha-dec-osf5.1b on current mainline like this:

/vol/gcc/src/gcc-dist/libgomp/env.c: In function 'parse_stacksize':
/vol/gcc/src/gcc-dist/libgomp/env.c:210: error: array subscript has type 'char'
/vol/gcc/src/gcc-dist/libgomp/env.c: In function 'parse_spincount':
/vol/gcc/src/gcc-dist/libgomp/env.c:279: error: array subscript has type 'char'

The following trivial patch fixes this and allow libgomp compilation to
complete.  I haven't yet run the testsuite since libstdc++ doesn't compile
(SEGV in cc1plus).

Ok for mainline anyway?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Mon Jun 16 17:44:18 2008  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* env.c (parse_stacksize): Cast arg to unsigned char.
	(parse_spincount): Likewise.

Index: libgomp/env.c
===================================================================
--- libgomp/env.c	(revision 136760)
+++ libgomp/env.c	(working copy)
@@ -207,7 +207,7 @@ parse_stacksize (const char *name, unsig
     ++end;
   if (*end != '\0')
     {
-      switch (tolower (*end))
+      switch (tolower ((unsigned char) *end))
 	{
 	case 'b':
 	  shift = 0;
@@ -276,7 +276,7 @@ parse_spincount (const char *name, unsig
     ++end;
   if (*end != '\0')
     {
-      switch (tolower (*end))
+      switch (tolower ((unsigned char) *end))
 	{
 	case 'k':
 	  mult = 1000LL;



More information about the Gcc-patches mailing list