Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. va_copy?

va_copy?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiohelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DQNOK
    wrote on last edited by
    #1

    The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David

    M D 2 Replies Last reply
    0
    • D DQNOK

      The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I don't know what it does, but maybe you need to implement your own using va_arg, va_end, va_start[^] Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • D DQNOK

        The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        If all else fails, you could roll your own, something like:

        #define va_copy(dest, src) ((void)((dest) = (src)))


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        D 1 Reply Last reply
        0
        • D David Crow

          If all else fails, you could roll your own, something like:

          #define va_copy(dest, src) ((void)((dest) = (src)))


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          D Offline
          D Offline
          DQNOK
          wrote on last edited by
          #4

          Thanks for the thought. Unfortunately, it's not that easy. These functions are compiler supplied for a good reason; they're inherently low-level and depend strongly on how the compiler pushes and pops the stack, alignment issues, and perhaps other things. I have seen one implementation where va_copy(dest, src) was a simple assignment of src to dest. But, on the other hand, if you've looked at Microsoft's implementation of va_start() etc. you know that a simple assignment may be WAY to naive. It MIGHT work, but then again, it might not. Or worse yet, it might work SOMETIMES. If someone out there KNOWS how it should be implemented in Visual Studio, I'll certainly try it, but I hate to just guess. David

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups