public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28584]  New: Cast to pointer from integer of different size [gcc 4.0.x  and 4.1.x on x86_64]
@ 2006-08-03 13:57 denis dot charland at imi dot cnrc-nrc dot gc dot ca
  2009-12-08 20:32 ` [Bug c++/28584] Cast to pointer from integer of different size redi at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: denis dot charland at imi dot cnrc-nrc dot gc dot ca @ 2006-08-03 13:57 UTC (permalink / raw)
  To: gcc-bugs

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 <cstdio>

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-09  7:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-03 13:57 [Bug c++/28584] New: Cast to pointer from integer of different size [gcc 4.0.x and 4.1.x on x86_64] denis dot charland at imi dot cnrc-nrc dot gc dot ca
2009-12-08 20:32 ` [Bug c++/28584] Cast to pointer from integer of different size redi at gcc dot gnu dot org
2010-02-20 18:19 ` manu at gcc dot gnu dot org
2010-02-20 20:15 ` jason at redhat dot com
2010-02-22 19:05 ` manu at gcc dot gnu dot org
2010-02-22 19:50 ` manu at gcc dot gnu dot org
2010-04-09  7:50 ` manu at gcc dot gnu dot org
2010-04-09  7:53 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).