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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Edward Diener

    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.
  • Jochen Kalmbach [MVP]

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

    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


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

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

    Greetings
    Jochen

    Comment

    • Bronek Kozicki

      #3
      Re: warning C4244: '=' : conversion from 'intptr_t' to 'long', possible loss of data in VC++ 7.1

      Edward Diener <ediener@no_spa m_incomm.comwro te:
      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?

      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.



      B.

      Comment

      • Edward Diener

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

        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

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

        Comment

        Working...