From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23637 invoked by alias); 3 Aug 2006 13:57:12 -0000 Received: (qmail 23577 invoked by uid 48); 3 Aug 2006 13:57:05 -0000 Date: Thu, 03 Aug 2006 13:57:00 -0000 Subject: [Bug c++/28584] New: Cast to pointer from integer of different size [gcc 4.0.x and 4.1.x on x86_64] X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "denis dot charland at imi dot cnrc-nrc dot gc dot ca" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-08/txt/msg00153.txt.bz2 List-Id: The following code does not generate any warning when compiled with g++ 4.0.x and 4.1.x on a x86_64 platform: /* #include int f(void); int f(void) { return (long) &std::printf; } */ typedef unsigned long mysize_t; void *mymmap(void *start, mysize_t length, int prot , int flags, int fd, int offset); //typedef unsigned long DWORD; typedef unsigned int DWORD; struct UDA { DWORD UserDirectAddr; DWORD TransAddr; DWORD Bytes; }; void f(UDA *puda); void f(UDA *puda) { puda->UserDirectAddr = (unsigned long) mymmap((void *) puda->TransAddr, puda->Bytes, 0, 0, 0, 0); } When compiled with g++ 3.4.6 on the same platform, the following warning is issued: g++ -c test.cpp test.cpp: In function `void f(UDA*)': test.cpp:30: warning: cast to pointer from integer of different size -- Summary: Cast to pointer from integer of different size [gcc 4.0.x and 4.1.x on x86_64] Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: denis dot charland at imi dot cnrc-nrc dot gc dot ca http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28584