From patchwork Wed Apr 24 09:59:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 239126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5B04B2C010B for ; Wed, 24 Apr 2013 20:00:27 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=oq2ZoGiJk7lRMsVjrlx5shYkINDsqQa3wk+jRIpFBSkv72 ZnAmOPkuuaBQItiMYomhcKW8Ii+LDqyz/7RZE0Cdc8Xbnm55RkiMCtujUSrOdOpE EHJhyzx29Pv0jHZULqphcSpKKZUc5OY2uva8XNlSc81ruJUwkzvXCTy+7R4+I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=nkBKQT5qk6SytTyEqh6qsHazFZQ=; b=WJn7twIOl8Wf/KA4yPDF AV3FSELMM2bId/KZZzDyVbgb5TQghV184j6onc8NAbv9jVPDhqlwUPT7vv+fGY2L ydjLuoZKpO3y8QjNoLpy64fkQGdEIDpBd+w8i38GNePptAc9SB9UU3U7xvVOaLIa dBn6TpdvBrlAqtmKliTDbbU= Received: (qmail 4828 invoked by alias); 24 Apr 2013 10:00:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4810 invoked by uid 89); 24 Apr 2013 10:00:19 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, FROM_12LTRDOM, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_CX, TW_FN, TW_GD autolearn=no version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 10:00:17 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UUwUp-0000j7-Ee from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Wed, 24 Apr 2013 03:00:15 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 24 Apr 2013 03:00:15 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Wed, 24 Apr 2013 11:00:10 +0100 Message-ID: <5177AD1F.1020101@codesourcery.com> Date: Wed, 24 Apr 2013 11:59:59 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 MIME-Version: 1.0 To: GCC Patches Subject: Fix C++ testcases for size_t vs intptr_t X-Virus-Found: No This fixes C++ testcases that used size_t when casting a pointer to integer so that they use intptr_t instead. There's also an testcase using pointer subtraction where ptrdiff_t is the correct choice, and a fix to the ptrmem.C testcase to use sizeof on a function pointer rather than a data pointer. A similar patch for C testcases was already applied last year. Bootstrapped and tested on x86_64-linux. Ok? Bernd gcc/testsuite/ * g++.old-deja/g++.mike/warn1.C (uintptr_t): Renamed from size_t. Use __UINTPTR_TYPE__. All uses changed. * g++.dg/other/offsetof3.C (uintptr_t): Likewise. * g++.dg/opt/switch3.C (uintptr_t): Likewise. * g++.dg/init/array11.C (uintptr_t): Likewise. * g++.dg/torture/pr41775.C (uintptr_t): Likewise. * g++.dg/tree-ssa/pr21082.C (b, c): Use __PTRDIFF_TYPE__. * g++.dg/debug/const2.C (b::d): Use __UINTPTR_TYPE__ instead of __SIZE_TYPE__. * g++.dg/parse/array-size2.C (foo): Likewise. * g++.dg/compat/struct-layout-1_x1.h (test##n): Likewise. * g++.dg/abi/offsetof.C (main): Likewise. * g++.dg/eh/alias1.C (g): Likewise. * g++.dg/init/static-init1.C (a): Likewise. * g++.dg/init/struct1.C (struct bug): Likewise. * g++.dg/init/struct2.C (saveOrLoad): Likewise. * g++.dg/init/struct3.C (foobar): Likewise. * g++.dg/torture/pr31579.C (a): Likewise. * g++.dg/torture/pr32563.C (i): Likewise. * g++.old-deja/g++.brendan/code-gen2.c (main): Use __UINTPTR_TYPE__ instead of __SIZE_TYPE__. * g++.old-deja/g++.other/temporary1.C: Likewise. * g++.old-deja/g++.pt/local1.C (setback): Likewise. * g++.old-deja/g++.pt/spec16.C (foo): Likewise. * g++.old-deja/g++.pt/local7.C (setback): Likewise. * g++.old-deja/g++.mike/net42.C (get_stat): Likewise. * g++.old-deja/g++.eh/ptr1.C (main): Likewise. * g++.old-deja/g++.brendan/crash64.C (uintptr_t): Define and use instead of size_t. * g++.old-deja/g++.abi/ptrmem.C (VPTE_SIZE): Define using a function pointer. diff --git a/gcc/testsuite/g++.dg/abi/offsetof.C b/gcc/testsuite/g++.dg/abi/offsetof.C index d6a53e6..68ba2d8 100644 --- a/gcc/testsuite/g++.dg/abi/offsetof.C +++ b/gcc/testsuite/g++.dg/abi/offsetof.C @@ -18,5 +18,5 @@ struct C: public B { }; int main () { - return ((__SIZE_TYPE__) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" } + return ((__UINTPTR_TYPE__) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" } } diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h index e14433e..e304841 100644 --- a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h +++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h @@ -56,7 +56,7 @@ void test##n (void) \ info.als = __alignof__ (s##n); \ info.ala0 = __alignof__ (a##n[0]); \ info.ala3 = __alignof__ (a##n[3]); \ - if (((long) (__SIZE_TYPE__) &a##n[3]) & (info.als - 1)) \ + if (((long) (__UINTPTR_TYPE__) &a##n[3]) & (info.als - 1)) \ FAIL (n, 1); \ i = 0; j = 0; \ ops \ diff --git a/gcc/testsuite/g++.dg/debug/const2.C b/gcc/testsuite/g++.dg/debug/const2.C index 8e98f8b..3f075b8 100644 --- a/gcc/testsuite/g++.dg/debug/const2.C +++ b/gcc/testsuite/g++.dg/debug/const2.C @@ -12,4 +12,4 @@ struct b virtual bool IsEmpty() const=0; int e,c; }; -const int b::d = ((__SIZE_TYPE__)(&((b*)1)->c) - 1); +const int b::d = ((__UINTPTR_TYPE__)(&((b*)1)->c) - 1); diff --git a/gcc/testsuite/g++.dg/eh/alias1.C b/gcc/testsuite/g++.dg/eh/alias1.C index e6af383..fc1ed64 100644 --- a/gcc/testsuite/g++.dg/eh/alias1.C +++ b/gcc/testsuite/g++.dg/eh/alias1.C @@ -16,7 +16,7 @@ void g (int i) { if (!i_glob) - exit ((__SIZE_TYPE__) & i); + exit ((__INTPTR_TYPE__) & i); } static void diff --git a/gcc/testsuite/g++.dg/init/array11.C b/gcc/testsuite/g++.dg/init/array11.C index e52effe..594678a 100644 --- a/gcc/testsuite/g++.dg/init/array11.C +++ b/gcc/testsuite/g++.dg/init/array11.C @@ -9,11 +9,11 @@ int x; -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; struct gdt { -size_t a,b,c,d,e,f; +uintptr_t a,b,c,d,e,f; }; void f() { @@ -21,7 +21,7 @@ struct gdt gdt_table[2]= { { 0, - ( (((size_t)(&x))<<(24))&(-1<<(8)) ), + ( (((uintptr_t)(&x))<<(24))&(-1<<(8)) ), }, }; } diff --git a/gcc/testsuite/g++.dg/init/static-init1.C b/gcc/testsuite/g++.dg/init/static-init1.C index 298d171..6852dad 100644 --- a/gcc/testsuite/g++.dg/init/static-init1.C +++ b/gcc/testsuite/g++.dg/init/static-init1.C @@ -2,4 +2,4 @@ // Make sure we don't think we can initialize a at compile time. char c; -short a[] = { (short)((__PTRDIFF_TYPE__)&c + (__PTRDIFF_TYPE__)&c) }; +short a[] = { (short)((__UINTPTR_TYPE__)&c + (__UINTPTR_TYPE__)&c) }; diff --git a/gcc/testsuite/g++.dg/init/struct1.C b/gcc/testsuite/g++.dg/init/struct1.C index e23faef..834dca1 100644 --- a/gcc/testsuite/g++.dg/init/struct1.C +++ b/gcc/testsuite/g++.dg/init/struct1.C @@ -1,6 +1,6 @@ struct bug { const char *name; - __SIZE_TYPE__ type; + __UINTPTR_TYPE__ type; }; -struct bug s = { 0, (__SIZE_TYPE__) &s | 1 }; +struct bug s = { 0, (__UINTPTR_TYPE__) &s | 1 }; diff --git a/gcc/testsuite/g++.dg/init/struct2.C b/gcc/testsuite/g++.dg/init/struct2.C index 85aacc6..53486c9 100644 --- a/gcc/testsuite/g++.dg/init/struct2.C +++ b/gcc/testsuite/g++.dg/init/struct2.C @@ -15,7 +15,7 @@ void saveOrLoad() { }; SaveLoadEntry trackEntries = { - ((long) (__SIZE_TYPE__) (&((Track *) 42)->soundName[0])) - 42, + ((long) (__UINTPTR_TYPE__) (&((Track *) 42)->soundName[0])) - 42, 0, 1 }; saveLoadEntries(&trackEntries); diff --git a/gcc/testsuite/g++.dg/init/struct3.C b/gcc/testsuite/g++.dg/init/struct3.C index 53804b3..3571cdf 100644 --- a/gcc/testsuite/g++.dg/init/struct3.C +++ b/gcc/testsuite/g++.dg/init/struct3.C @@ -12,4 +12,4 @@ struct SaveLoadEntry { int size; }; -int foobar = ((long) (__SIZE_TYPE__) (& ((Track *) 42)->soundName[0])) - 42; +int foobar = ((long) (__UINTPTR_TYPE__) (& ((Track *) 42)->soundName[0])) - 42; diff --git a/gcc/testsuite/g++.dg/opt/switch3.C b/gcc/testsuite/g++.dg/opt/switch3.C index 643cac3..9fbb4cf 100644 --- a/gcc/testsuite/g++.dg/opt/switch3.C +++ b/gcc/testsuite/g++.dg/opt/switch3.C @@ -3,10 +3,10 @@ // { dg-options "-O2" } void f (void); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; void g (void *a) { - size_t b = (size_t) a; + uintptr_t b = (uintptr_t) a; switch (b) { case 1: diff --git a/gcc/testsuite/g++.dg/other/offsetof3.C b/gcc/testsuite/g++.dg/other/offsetof3.C index 5946c81..dc47b5a 100644 --- a/gcc/testsuite/g++.dg/other/offsetof3.C +++ b/gcc/testsuite/g++.dg/other/offsetof3.C @@ -11,7 +11,7 @@ protected: }; typedef X* pX; -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; -size_t yoff = size_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */ +uintptr_t yoff = uintptr_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */ /* { dg-warning "macro was used incorrectly" "macro" { target *-*-* } 16 } */ diff --git a/gcc/testsuite/g++.dg/other/offsetof4.C b/gcc/testsuite/g++.dg/other/offsetof4.C index ab2282e..4930591 100644 --- a/gcc/testsuite/g++.dg/other/offsetof4.C +++ b/gcc/testsuite/g++.dg/other/offsetof4.C @@ -11,6 +11,6 @@ struct X }; typedef X* pX; -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; -size_t yoff = size_t(&(pX(0)->y)); +uintptr_t yoff = uintptr_t(&(pX(0)->y)); diff --git a/gcc/testsuite/g++.dg/parse/array-size2.C b/gcc/testsuite/g++.dg/parse/array-size2.C index 355ed61..94ec5fb 100644 --- a/gcc/testsuite/g++.dg/parse/array-size2.C +++ b/gcc/testsuite/g++.dg/parse/array-size2.C @@ -15,6 +15,6 @@ void foo (void) { char g[(char *) &((struct S *) 0)->b - (char *) 0]; - char h[(__SIZE_TYPE__) &((struct S *) 8)->b]; + char h[(__UINTPTR_TYPE__) &((struct S *) 8)->b]; bar (g, h); } diff --git a/gcc/testsuite/g++.dg/torture/pr31579.C b/gcc/testsuite/g++.dg/torture/pr31579.C index 131532e..10cc1c8 100644 --- a/gcc/testsuite/g++.dg/torture/pr31579.C +++ b/gcc/testsuite/g++.dg/torture/pr31579.C @@ -5,6 +5,6 @@ struct Industry { unsigned char produced_cargo[2]; }; -unsigned int a = (((__SIZE_TYPE__)&reinterpret_cast((((Industry*)(char*)8)->produced_cargo[0]))) - 8); diff --git a/gcc/testsuite/g++.dg/torture/pr32563.C b/gcc/testsuite/g++.dg/torture/pr32563.C index d536b3f..2d2f32a 100644 --- a/gcc/testsuite/g++.dg/torture/pr32563.C +++ b/gcc/testsuite/g++.dg/torture/pr32563.C @@ -5,4 +5,4 @@ struct A char c[1]; } a; -const __SIZE_TYPE__ i = (__SIZE_TYPE__)&a.c[0] - 1; +const __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a.c[0] - 1; diff --git a/gcc/testsuite/g++.dg/torture/pr41775.C b/gcc/testsuite/g++.dg/torture/pr41775.C index 3d8548e..3951916 100644 --- a/gcc/testsuite/g++.dg/torture/pr41775.C +++ b/gcc/testsuite/g++.dg/torture/pr41775.C @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-require-visibility "" } */ -typedef unsigned int size_t; +typedef unsigned int uintptr_t; namespace std __attribute__ ((__visibility__ ("default"))) { template < typename _Iterator > struct iterator_traits @@ -42,14 +42,14 @@ extern "C" { extern "C" { - __extension__ typedef __SIZE_TYPE__ __intptr_t; + __extension__ typedef __UINTPTR_TYPE__ __intptr_t; } } namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { template < typename _Tp > class new_allocator { - public:typedef size_t size_type; + public:typedef uintptr_t uintptr_type; typedef _Tp *pointer; template < typename _Tp1 > struct rebind { diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr21082.C b/gcc/testsuite/g++.dg/tree-ssa/pr21082.C index d6c2fa1..f421af6 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr21082.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr21082.C @@ -4,7 +4,7 @@ void link_error(); int a[4]; -__INTPTR_TYPE__ b, c; +__PTRDIFF_TYPE__ b, c; int main() { diff --git a/gcc/testsuite/g++.dg/warn/pr33160.C b/gcc/testsuite/g++.dg/warn/pr33160.C index e463e2d..a24e105 100644 --- a/gcc/testsuite/g++.dg/warn/pr33160.C +++ b/gcc/testsuite/g++.dg/warn/pr33160.C @@ -2,7 +2,7 @@ // { dg-do compile } // { dg-options "-Wall -Wextra -Wpointer-arith -pedantic -Wconversion" } -typedef int __attribute__((mode(pointer))) intptr_t; +typedef __INTPTR_TYPE__ intptr_t; int foo(void) { intptr_t t = 0; diff --git a/gcc/testsuite/g++.dg/warn/sequence-pt-1.C b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C index 6a98fd7..dd8dbc1 100644 --- a/gcc/testsuite/g++.dg/warn/sequence-pt-1.C +++ b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C @@ -15,7 +15,7 @@ extern int fnb (int, int); extern int fnc (int *); extern int sprintf (char *, const char *, ...); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; void foo (int a, int b, int n, int p, int *ptr, struct s *sptr, @@ -32,9 +32,9 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr, ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */ cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" } */ cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */ - *ptr++ = (size_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ + *ptr++ = (uintptr_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" } */ - sptr->a = (size_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ + sptr->a = (uintptr_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */ a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */ b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */ diff --git a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C index 3417358..b72db88 100644 --- a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C +++ b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C @@ -22,7 +22,7 @@ #define VPTE_SIZE (16) #else #define CMP_PTRFN(A, B) ((A) == (B)) -#define VPTE_SIZE sizeof(void *) +#define VPTE_SIZE sizeof(void (*)()) #endif #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C index 730f0f9..76865e4 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C @@ -10,7 +10,7 @@ int main () char buff[40] ; char *tmp = &buff[0]; // also fails for char *tmp = buff; - if ((__SIZE_TYPE__) tmp != (__SIZE_TYPE__) &buff[0]) + if ((__UINTPTR_TYPE__) tmp != (__UINTPTR_TYPE__) &buff[0]) { printf ("FAIL\n"); return 1; } else printf ("PASS\n"); diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C index 5fd31a6..f7fe100 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C @@ -1,6 +1,6 @@ // { dg-do assemble { target c++98 } } // GROUPS passed old-abort -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; typedef void (*RF_Ptr)(void *); struct _im_pers_mem_spec { @@ -16,4 +16,4 @@ struct metatype { int base_list; }; static _type_desc _type_metatype("metatype", sizeof(metatype), (RF_Ptr)0, 0, 1, 1, - _im_pers_mem_spec( ((size_t)&((( metatype *)0)-> base_list )) , 1)); + _im_pers_mem_spec( ((uintptr_t)&((( metatype *)0)-> base_list )) , 1)); diff --git a/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C b/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C index aefe5cc..a522b4c 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C @@ -16,8 +16,8 @@ int main() } catch (E *&e) { - printf ("address of e is 0x%lx\n", (__SIZE_TYPE__)e); - return !((__SIZE_TYPE__)e != 5 && e->x == 5); + printf ("address of e is 0x%lx\n", (__UINTPTR_TYPE__)e); + return !((__UINTPTR_TYPE__)e != 5 && e->x == 5); } return 2; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net42.C b/gcc/testsuite/g++.old-deja/g++.mike/net42.C index 1205812..4d19c22 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net42.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net42.C @@ -16,7 +16,7 @@ get_stat() { unsigned long bit = 1; unsigned long sigignore = 0; int i = 0; - switch((__SIZE_TYPE__) (*p)->sigaction[i].sa_handler) + switch((__UINTPTR_TYPE__) (*p)->sigaction[i].sa_handler) { case 1: sigignore |= bit; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C index 5d6fdec..203acaf 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C @@ -2,9 +2,9 @@ // { dg-options "-Wall -Wno-int-to-pointer-cast" } typedef char * charptr; -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; char c[]={'A','B','C','D'}; -int i=size_t(&c); +int i=uintptr_t(&c); int *pp=&i; void foo() { } int main() diff --git a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C index b1c8cd6..ea63ac3 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C @@ -5,16 +5,16 @@ int c, d; class Foo { public: - Foo() { printf("Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++c; } - Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); } - ~Foo() { printf("~Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++d; } + Foo() { printf("Foo() 0x%08lx\n", (__UINTPTR_TYPE__)this); ++c; } + Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__UINTPTR_TYPE__)this); } + ~Foo() { printf("~Foo() 0x%08lx\n", (__UINTPTR_TYPE__)this); ++d; } }; // Bar creates constructs a temporary Foo() as a default class Bar { public: - Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); } + Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (__UINTPTR_TYPE__)this); } }; void fakeRef(Bar *) diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local1.C b/gcc/testsuite/g++.old-deja/g++.pt/local1.C index d73a030..08e32b3 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/local1.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/local1.C @@ -5,7 +5,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset) if(!bp) return 0; union { int i; MEMBER STRUCT::*of; } u; u.of = offset; - return (STRUCT *) ((__SIZE_TYPE__) bp - u.i); + return (STRUCT *) ((__UINTPTR_TYPE__) bp - u.i); } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local7.C b/gcc/testsuite/g++.old-deja/g++.pt/local7.C index 96b19fc..206bbad 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/local7.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/local7.C @@ -6,7 +6,7 @@ setback(MEMBER *bp, MEMBER STRUCT::*offset) if(!bp) return 0; union { int i; MEMBER STRUCT::*of; } u; u.of = offset; - return (STRUCT *) ((__SIZE_TYPE__) bp - u.i); + return (STRUCT *) ((__UINTPTR_TYPE__) bp - u.i); } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec16.C b/gcc/testsuite/g++.old-deja/g++.pt/spec16.C index dbe4426..3c453b5 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/spec16.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec16.C @@ -17,5 +17,5 @@ template<> int A::foo(const char*const& k) { - return((__SIZE_TYPE__)k); + return((__UINTPTR_TYPE__)k); }