Commit efdbc6f8 by Richard Henderson

code-gen2.C: Cast to size_t, not int.

          * g++.old-deja/g++.brendan/code-gen2.C: Cast to size_t, not int.
          * g++.old-deja/g++.mike/warn1.C: Likewise.
          * g++.old-deja/g++.pt/local1.C: Likewise.
          * g++.old-deja/g++.pt/local7.C: Likewise.
          * g++.old-deja/g++.pt/spec16.C: Likewise.

From-SVN: r33741
parent bf061ee4
2000-05-06 Richard Henderson <rth@cygnus.com>
* g++.old-deja/g++.brendan/code-gen2.C: Cast to size_t, not int.
* g++.old-deja/g++.mike/warn1.C: Likewise.
* g++.old-deja/g++.pt/local1.C: Likewise.
* g++.old-deja/g++.pt/local7.C: Likewise.
* g++.old-deja/g++.pt/spec16.C: Likewise.
2000-05-06 Nathan Sidwell <nathan@codesourcery.com> 2000-05-06 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.abi/ptrflags.C: Correct and extend. * g++.old-deja/g++.abi/ptrflags.C: Correct and extend.
......
...@@ -9,7 +9,7 @@ int main () ...@@ -9,7 +9,7 @@ int main ()
char buff[40] ; char buff[40] ;
char *tmp = &buff[0]; // also fails for char *tmp = buff; char *tmp = &buff[0]; // also fails for char *tmp = buff;
if ((unsigned int) tmp != (unsigned int) &buff[0]) if ((__SIZE_TYPE__) tmp != (__SIZE_TYPE__) &buff[0])
printf ("FAIL\n"); printf ("FAIL\n");
else else
printf ("PASS\n"); printf ("PASS\n");
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
// Special g++ Options: -Wall // Special g++ Options: -Wall
typedef char * charptr; typedef char * charptr;
typedef __SIZE_TYPE__ size_t;
char c[]={'A','B','C','D'}; char c[]={'A','B','C','D'};
int i=int(&c); int i=size_t(&c);
int *pp=&i; int *pp=&i;
void foo() { } void foo() { }
int main() int main()
......
...@@ -4,7 +4,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset) ...@@ -4,7 +4,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset)
if(!bp) return 0; if(!bp) return 0;
union { int i; MEMBER STRUCT::*of; } u; union { int i; MEMBER STRUCT::*of; } u;
u.of = offset; u.of = offset;
return (STRUCT *) ((int) bp - u.i); return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
} }
......
...@@ -7,7 +7,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset) ...@@ -7,7 +7,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset)
if(!bp) return 0; if(!bp) return 0;
union { int i; MEMBER STRUCT::*of; } u; union { int i; MEMBER STRUCT::*of; } u;
u.of = offset; u.of = offset;
return (STRUCT *) ((int) bp - u.i); return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
} }
......
...@@ -17,5 +17,5 @@ template<> ...@@ -17,5 +17,5 @@ template<>
int int
A<const char*>::foo(const char*const& k) A<const char*>::foo(const char*const& k)
{ {
return((int)k); return((__SIZE_TYPE__)k);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment