[llvm-commits] [llvm-gcc-4.2] r55725 - in /llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja: g++.abi/vbase1.C g++.brendan/template8.C g++.jason/access23.C g++.law/cvt8.C g++.law/operators28.C g++.mike/net35.C g++.mike/offset1.C g++.mike/p12306.C g++.mike/p3579.C g++.mike/p3708.C g++.mike/p3708a.C g++.mike/p3708b.C g++.mike/p646.C g++.mike/p710.C g++.mike/p789a.C g++.mike/pmf2.C g++.mike/temp.C g++.other/virtual8.C g++.pt/memtemp23.C g++.pt/memtemp24.C g++.pt/memtemp25.C g++.pt/memtemp26.C g++.pt/t39.C g++.robertl/eb17.C
Bill Wendling
isanbard at gmail.com
Wed Sep 3 13:47:21 PDT 2008
Author: void
Date: Wed Sep 3 15:47:20 2008
New Revision: 55725
URL: http://llvm.org/viewvc/llvm-project?rev=55725&view=rev
Log:
Change printf format strings to pass with -Wformat-security on. This syncs up
with Apple's GCC r150332.
Modified:
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.brendan/template8.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.jason/access23.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/cvt8.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/operators28.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/net35.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/offset1.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p12306.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3579.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p646.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p710.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p789a.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/temp.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.other/virtual8.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/t39.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.abi/vbase1.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C Wed Sep 3 15:47:20 2008
@@ -33,7 +33,8 @@
void Offset () const
{
printf ("VBase\n");
- printf (" VBase::member %d\n", &this->VBase::member - (int *)this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf (" VBase::member %d\n", int(&this->VBase::member - (int *)this));
}
};
@@ -55,8 +56,10 @@
void Offset () const
{
printf ("VDerived\n");
- printf (" VBase::member %d\n", &this->VBase::member - (int *)this);
- printf (" VDerived::member %d\n", &this->VDerived::member - (int *)this);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf (" VBase::member %d\n", int(&this->VBase::member - (int *)this));
+ printf (" VDerived::member %d\n", int(&this->VDerived::member - (int *)this));
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
}
};
struct B : virtual VBase
@@ -65,8 +68,10 @@
void Offset () const
{
printf ("B\n");
- printf (" VBase::member %d\n", &this->VBase::member - (int *)this);
- printf (" B::member %d\n", &this->B::member - (int *)this);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf (" VBase::member %d\n", int(&this->VBase::member - (int *)this));
+ printf (" B::member %d\n", int(&this->B::member - (int *)this));
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
}
};
struct MostDerived : B, virtual VDerived
@@ -75,10 +80,12 @@
void Offset () const
{
printf ("MostDerived\n");
- printf (" VBase::member %d\n", &this->VBase::member - (int *)this);
- printf (" B::member %d\n", &this->B::member - (int *)this);
- printf (" VDerived::member %d\n", &this->VDerived::member - (int *)this);
- printf (" MostDerived::member %d\n", &this->MostDerived::member - (int *)this);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf (" VBase::member %d\n", int(&this->VBase::member - (int *)this));
+ printf (" B::member %d\n", int(&this->B::member - (int *)this));
+ printf (" VDerived::member %d\n", int(&this->VDerived::member - (int *)this));
+ printf (" MostDerived::member %d\n", int(&this->MostDerived::member - (int *)this));
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
}
};
@@ -95,10 +102,12 @@
if (ctorVDerived != &dum.VDerived::member)
return 24;
- printf (" VBase::member %d\n", &dum.VBase::member - this_);
- printf (" B::member %d\n", &dum.B::member - this_);
- printf (" VDerived::member %d\n", &dum.VDerived::member - this_);
- printf (" MostDerived::member %d\n", &dum.MostDerived::member - this_);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf (" VBase::member %d\n", int(&dum.VBase::member - this_));
+ printf (" B::member %d\n", int(&dum.B::member - this_));
+ printf (" VDerived::member %d\n", int(&dum.VDerived::member - this_));
+ printf (" MostDerived::member %d\n", int(&dum.MostDerived::member - this_));
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
dum.MostDerived::Offset ();
dum.B::Offset ();
dum.VDerived::Offset ();
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.brendan/template8.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.brendan/template8.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.brendan/template8.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.brendan/template8.C Wed Sep 3 15:47:20 2008
@@ -15,6 +15,7 @@
Double_alignt<20000> heap;
- printf(" &heap.array[0] = %d, &heap.for_alignt = %d\n", &heap.array[0], &heap.for_alignt);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf(" &heap.array[0] = %p, &heap.for_alignt = %p\n", (void*)&heap.array[0], (void*)&heap.for_alignt);
}
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.jason/access23.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.jason/access23.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.jason/access23.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.jason/access23.C Wed Sep 3 15:47:20 2008
@@ -42,14 +42,18 @@
void DoSomething() {
PUB_A = 0;
Foo::A = 0;
- printf("%x\n",pX);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",pX);
Foo::PUB.A = 0;
- printf("%x\n",PUB.pX);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",PUB.pX);
B = 0;
- printf("%x\n",Foo::pY);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",Foo::pY);
PRT_A = 0;
PRT.B = 0;
- printf("%x\n",Foo::PRT.pY);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",Foo::PRT.pY);
PRV_A = 0; // { dg-error "" }
Foo::C = 0; // { dg-error "" }
printf("%x\n",pZ); // { dg-error "" }
@@ -64,7 +68,8 @@
a.PUB_A = 0;
a.A = 0;
- printf("%x\n",a.pX);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",a.pX);
a.PRT_A = 0; // { dg-error "" }
a.B = 0; // { dg-error "" }
printf("%x\n",a.pY); // { dg-error "" }
@@ -72,7 +77,8 @@
a.C = 0; // { dg-error "" }
printf("%x\n",a.pZ); // { dg-error "" }
a.PUB.A = 0;
- printf("%x\n",a.PUB.pX);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n",a.PUB.pX);
a.PRT.B = 0; // { dg-error "" }
printf("%x\n",a.PRT.pY); // { dg-error "" }
a.PRV.C = 0; // { dg-error "" }
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/cvt8.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.law/cvt8.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/cvt8.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/cvt8.C Wed Sep 3 15:47:20 2008
@@ -20,12 +20,14 @@
B::operator const A&() const {
static A a;
a.i = i;
- printf("convert B to A at %x\n", &a);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("convert B to A at %p\n", (void*)&a);
return a;
}
void f(A &a) { // { dg-error "" } in passing argument
- printf("A at %x is %d\n", &a, a.i);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("A at %p is %d\n", (void*)&a, a.i);
}
int main() {
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/operators28.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.law/operators28.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/operators28.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.law/operators28.C Wed Sep 3 15:47:20 2008
@@ -14,7 +14,8 @@
{
void *p;
- printf("%d %d %d\n", sz, count, type);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%d %d %d\n", (int)sz, count, type);
p = new char[sz * count];
((new_test *)p)->type = type;
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/net35.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/net35.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/net35.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/net35.C Wed Sep 3 15:47:20 2008
@@ -17,10 +17,12 @@
int main() {
C c;
- printf("&c.x = %x\n", &c.x);
- printf("&c.B1::x = %x\n", &c.B1::x);
- printf("&c.B2::x = %x\n", &c.B2::x);
- printf("&c.A::x = %x\n", &c.A::x);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf("&c.x = %p\n", (void*)&c.x);
+ printf("&c.B1::x = %p\n", (void*)&c.B1::x);
+ printf("&c.B2::x = %p\n", (void*)&c.B2::x);
+ printf("&c.A::x = %p\n", (void*)&c.A::x);
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
if (&c.x != &c.B1::x
|| &c.x != &c.B2::x
|| &c.x != &c.A::x)
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/offset1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/offset1.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/offset1.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/offset1.C Wed Sep 3 15:47:20 2008
@@ -6,7 +6,8 @@
class Foo {
public:
virtual void setName() {
- printf("Foo at %x\n", this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("Foo at %p\n", (void*)this);
if (vp != (void*)this)
fail = 1;
}
@@ -15,7 +16,8 @@
class Bar : public Foo {
public:
virtual void init(int argc, char **argv) {
- printf("Bar's Foo at %x\n", (Foo*)this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("Bar's Foo at %p\n", (void*)(Foo*)this);
vp = (void*)(Foo*)this;
setName();
}
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p12306.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p12306.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p12306.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p12306.C Wed Sep 3 15:47:20 2008
@@ -18,7 +18,8 @@
if (ptr2 != &(*this).slist)
fail = 6;
- if (0) printf("at %x %x\n", (RWSlistIterator*)this, &(*this).slist);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ if (0) printf("at %p %p\n", (void*)(RWSlistIterator*)this, (void*)&(*this).slist);
}
};
@@ -54,14 +55,18 @@
void Sim_Event_Manager::post_event () {
ptr1 = (RWSlistIterator*)&last_posted_event_position_;
ptr2 = &((RWSlistIterator*)&last_posted_event_position_)->slist;
- if (0) printf("at %x %x\n", (RWSlistIterator*)&last_posted_event_position_,
- &((RWSlistIterator*)&last_posted_event_position_)->slist);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ if (0) printf("at %p %p\n", (void*)(RWSlistIterator*)&last_posted_event_position_,
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ (void*)&((RWSlistIterator*)&last_posted_event_position_)->slist);
if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
fail = 1;
if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
fail = 2;
- if (0) printf("at %x ?%x\n", (RWSlistIterator*)&last_posted_event_position_,
- &((RWSlistIterator&)last_posted_event_position_).slist);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ if (0) printf("at %p ?%p\n", (void*)(RWSlistIterator*)&last_posted_event_position_,
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ (void*)&((RWSlistIterator&)last_posted_event_position_).slist);
if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
fail = 3;
if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3579.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p3579.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3579.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3579.C Wed Sep 3 15:47:20 2008
@@ -7,26 +7,32 @@
class Y {
public:
- Y () { printf("Y() this: %x\n", this); }
- ~Y () { printf("~Y() this: %x\n", this); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ Y () { printf("Y() this: %p\n", (void*)this); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ ~Y () { printf("~Y() this: %p\n", (void*)this); }
};
class X {
public:
X () {
++num_x;
- printf("X() this: %x\n", this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("X() this: %p\n", (void*)this);
Y y;
*this = (X) y;
}
- X (const Y & yy) { printf("X(const Y&) this: %x\n", this); ++num_x; }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ X (const Y & yy) { printf("X(const Y&) this: %p\n", (void*)this); ++num_x; }
X & operator = (const X & xx) {
- printf("X.op=(X&) this: %x\n", this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("X.op=(X&) this: %p\n", (void*)this);
return *this;
}
- ~X () { printf("~X() this: %x\n", this); --num_x; }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ ~X () { printf("~X() this: %p\n", (void*)this); --num_x; }
};
int main (int, char **) {
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p3708.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708.C Wed Sep 3 15:47:20 2008
@@ -38,7 +38,8 @@
virtual void xx(int doit) {
--num;
if (ptr != this)
- printf("FAIL\n%x != %x\n", ptr, this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("FAIL\n%p != %p\n", ptr, (void*)this);
printf ("C is destructed.\n");
B::xx (0);
if (doit) A::xx (1);
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p3708a.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C Wed Sep 3 15:47:20 2008
@@ -38,7 +38,8 @@
virtual void xx(int doit) {
--num;
if (ptr != this)
- printf("FAIL\n%x != %x\n", ptr, this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("FAIL\n%p != %p\n", ptr, (void*)this);
printf ("C is destructed.\n");
B::xx (0);
if (doit) A::xx (1);
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p3708b.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C Wed Sep 3 15:47:20 2008
@@ -48,7 +48,8 @@
virtual void xx(int doit) {
--num;
if (ptr != this) {
- printf("FAIL\n%x != %x\n", ptr, this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("FAIL\n%p != %p\n", ptr, (void*)this);
exit(1);
}
printf ("D is destructed.\n");
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p646.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p646.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p646.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p646.C Wed Sep 3 15:47:20 2008
@@ -35,20 +35,23 @@
foo::foo ()
{
si++;
- printf ("new foo @ 0x%x; now %d foos\n", this, si);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf ("new foo @ 0x%p; now %d foos\n", (void*)this, si);
}
foo::foo (const foo &other)
{
si++;
- printf ("another foo @ 0x%x; now %d foos\n", this, si);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf ("another foo @ 0x%p; now %d foos\n", (void*)this, si);
*this = other;
}
foo::~foo ()
{
si--;
- printf ("deleted foo @ 0x%x; now %d foos\n", this, si);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf ("deleted foo @ 0x%p; now %d foos\n", (void*)this, si);
}
int
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p710.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p710.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p710.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p710.C Wed Sep 3 15:47:20 2008
@@ -30,7 +30,8 @@
virtual ~B() {}
void operator delete(void*,size_t s)
{
- printf("B::delete() %d\n",s);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("B::delete() %d\n", (int)s);
}
void operator delete(void*){}
};
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p789a.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/p789a.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p789a.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/p789a.C Wed Sep 3 15:47:20 2008
@@ -13,10 +13,12 @@
int x;
foo () {
x = count++;
- printf("this %d = %x\n", x, (void *)this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("this %d = %p\n", x, (void *)this);
}
virtual ~foo () {
- printf("this %d = %x\n", x, (void *)this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("this %d = %p\n", x, (void *)this);
--count;
}
};
@@ -31,7 +33,8 @@
{
for (int j = 0; j < 3; j++)
{
- printf("&a[%d][%d] = %x\n", i, j, (void *)&array[i][j]);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("&a[%d][%d] = %p\n", i, j, (void *)&array[i][j]);
}
}
// The count should be nine, if not, fail the test.
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/pmf2.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C Wed Sep 3 15:47:20 2008
@@ -42,7 +42,8 @@
bar jar;
int main() {
- printf("ptr to B_table=%x, ptr to A_table=%x\n",&b,(A_table*)&b);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("ptr to B_table=%p, ptr to A_table=%p\n",(void*)&b,(void*)(A_table*)&b);
B_table::B_ti_fn z = &B_table::func1;
int j = 1;
jar.call_fn_fn1(j,(void *)&z);
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/temp.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.mike/temp.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/temp.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.mike/temp.C Wed Sep 3 15:47:20 2008
@@ -7,11 +7,13 @@
public:
T() {
i = 1;
- printf("T() at %x\n", this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("T() at %p\n", (void*)this);
}
T(const T& o) {
i = o.i;
- printf("T(const T&) at %x <-- %x\n", this, &o);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("T(const T&) at %p <-- %p\n", (void*)this, (void*)&o);
}
T operator +(const T& o) {
T r;
@@ -21,7 +23,8 @@
operator int () {
return i;
}
- ~T() { printf("~T() at %x\n", this); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ ~T() { printf("~T() at %p\n", (void*)this); }
} s, b;
int foo() { return getenv("TEST") == 0; }
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.other/virtual8.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.other/virtual8.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.other/virtual8.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.other/virtual8.C Wed Sep 3 15:47:20 2008
@@ -4,7 +4,8 @@
struct A
{
virtual void f () {
- printf ("%x\n", this);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf ("%p\n", (void*)this);
}
};
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.pt/memtemp23.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C Wed Sep 3 15:47:20 2008
@@ -13,7 +13,8 @@
template <class U>
void f(U u)
- { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ { printf ("In S::f(U)\nsizeof(U) == %d\n", (int)sizeof(u)); }
int c[16];
};
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.pt/memtemp24.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C Wed Sep 3 15:47:20 2008
@@ -13,7 +13,8 @@
template <class U>
void f(U u)
- { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ { printf ("In S::f(U)\nsizeof(U) == %d\n", (int)sizeof(u)); }
int c[16];
};
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.pt/memtemp25.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C Wed Sep 3 15:47:20 2008
@@ -6,7 +6,8 @@
struct S
{
template <class U>
- void f(U u) { printf ("%d\n", sizeof (U)); }
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ void f(U u) { printf ("%d\n", (int)sizeof (U)); }
int i[4];
};
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.pt/memtemp26.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C Wed Sep 3 15:47:20 2008
@@ -16,7 +16,8 @@
template <class U>
void S<X>::f(U u)
{
- printf ("%d\n", sizeof (U));
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf ("%d\n", (int)sizeof (U));
}
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/t39.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.pt/t39.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/t39.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.pt/t39.C Wed Sep 3 15:47:20 2008
@@ -10,8 +10,10 @@
template <class T>
void frob<T>::print () {
- printf ("this = %08x\n", this);
- printf (" ptr = %08x\n", ptr);
+ /* APPLE LOCAL begin default to Wformat-security 5764921 */
+ printf ("this = %p\n", (void*)this);
+ printf (" ptr = %p\n", (void*)ptr);
+ /* APPLE LOCAL end default to Wformat-security 5764921 */
printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
}
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.old-deja/g%2B%2B.robertl/eb17.C?rev=55725&r1=55724&r2=55725&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C Wed Sep 3 15:47:20 2008
@@ -44,15 +44,18 @@
A * a = new B;
B * b = dynamic_cast<B *>(a);
- printf("%p\n",b); // (*2*)
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n", (void*)b); // (*2*)
b->print();
a = b;
- printf("%p\n",a);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n", (void*)a);
a->print();
a = a->clone();
- printf("%p\n",a);
+ /* APPLE LOCAL default to Wformat-security 5764921 */
+ printf("%p\n", (void*)a);
a->print(); // (*1*)
return 0;
More information about the llvm-commits
mailing list