473,462 Members | 1,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

warning C4244: '=' : conversion from 'intptr_t' to 'long', possibleloss of data in VC++ 7.1

I am getting the above warning when compiling a line in a file which
assigns an 'intptr_t' result to a 'long' variable. I do not see how
intptr_t can possibly be larger than a long unless intptr_t is a 64 bit
value and I know I am not compiling for 64 bit Windows.
Aug 2 '06 #1
3 3406
Hi Edward!
I am getting the above warning when compiling a line in a file which
assigns an 'intptr_t' result to a 'long' variable. I do not see how
intptr_t can possibly be larger than a long unless intptr_t is a 64 bit
value and I know I am not compiling for 64 bit Windows.
Maybe you have enabled /Wp64 compiler Flag
http://msdn2.microsoft.com/en-us/library/yt4xw8fh.aspx

This is ON by default for new VC2005 projects...

You can disable it in your project settings under "C/C++|General|Detect
64-bit Portability Issues"

Greetings
Jochen
Aug 2 '06 #2
Edward Diener <ediener@no_spam_incomm.comwrote:
I am getting the above warning when compiling a line in a file which
assigns an 'intptr_t' result to a 'long' variable. I do not see how
intptr_t can possibly be larger than a long unless intptr_t is a 64
bit value and I know I am not compiling for 64 bit Windows.
do you have /Wp64 compiler option set?

http://msdn.microsoft.com/library/en...tyProblems.asp
B.

Aug 2 '06 #3
Jochen Kalmbach [MVP] wrote:
Hi Edward!
>I am getting the above warning when compiling a line in a file which
assigns an 'intptr_t' result to a 'long' variable. I do not see how
intptr_t can possibly be larger than a long unless intptr_t is a 64
bit value and I know I am not compiling for 64 bit Windows.

Maybe you have enabled /Wp64 compiler Flag
http://msdn2.microsoft.com/en-us/library/yt4xw8fh.aspx

This is ON by default for new VC2005 projects...
Woops, you're right. Evidently it is on by default in VS2003 also. Thanks !
Aug 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: junky_fellow | last post by:
Consider a function: void *test_func(void) { return ((void *)-1); } While returning, the integer -1 is converted to void *. Is this portable ?
1
by: Josué Andrade Gomes | last post by:
Take this code: 1: int main() 2: { 3: unsigned short x = { 1, 2, 3, 4, 5 }; 4: unsigned short sum = 0; 5: 6: for (int i = 0; i < 5; ++i) { 7: sum += x; 8: } 9: }
11
by: Henryk | last post by:
I have some very simple code fragment: short int n1, n2; .... n1 += n2; I get an warning from VS2003 - VS2005: warning C4244: '+=' : conversion from 'int' to 'short', possible loss of data ...
2
by: Robbie Hatley | last post by:
I'm getting a strange warning at work when I compile any file in our product that contains a deque of a particular struct. I don't understand this warning, so I'm not sure if this is a Microsoft...
6
by: icecrime | last post by:
Hi, I have a small interrogation concerning pointer to integer conversion: how is it possible to safely and portably print a memory address ? From what I understand (according to FAQ 4.14),...
0
by: malini | last post by:
Hi I am new to vc++. currently using VC 2005 version 8 Someone help me solve this. lpppublishdimincent.cpp(294) : warning C4244: 'argument' : conversion from 'const lpmINT64' to 'char', possible...
1
by: zelmila19 | last post by:
Hello, this part of my program: int shotDistance(int a) { int min = a * .8, max = a * 1.2; //Defines the minimum and maximum range of the club. srand ((unsigned int) time(NULL)); a...
21
by: Roman Mashak | last post by:
Hello, given a simple code: #include <math.h> long hyp(long height, long base) { return sqrt(height * height + base * base); }
2
by: david | last post by:
I've noticed that the following compiles (as C) under both VS8 and gcc with no warnings, even though there's a possibility of data truncation from enum to unsigned char. It does generate a warning...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.