Variable argument functions

This is a discussion on Variable argument functions within the C Programming forums, part of the General Programming Boards category; Are there any re-entrancy issues using va_start va_arg va_end calling a variable argument function from another variable argument function? Can ...

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    3

    Variable argument functions

    Are there any re-entrancy issues using
    va_start
    va_arg
    va_end

    calling a variable argument function from another variable argument function? Can they collide and cause problems?

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    38
    None that I am aware of.

    Variable argument function calls happen just like any other and the arguments are passed in the same manner. It is just up to the programmer to determine how many and what kind of variables have been passed.

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    3
    To be more specific, while I understand how to use va_start and va_arg, I'm not sure what they're doing under the hood.

    Is it a problem to launch another variable argument function right in the middle of a va_start, va_arg routine, before va_end is called? The new function will start it's own va_start, va_arg routine.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >I'm not sure what they're doing under the hood.
    Something implementation dependent.

    >Is it a problem to launch another variable argument function right in the middle of a va_start, va_arg routine, before va_end is called?
    No.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 07-26-2007, 02:08 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 06:36 AM
  3. Use of variable
    By alice in forum C Programming
    Replies: 8
    Last Post: 06-05-2004, 08:32 AM
  4. I'll have a Variable argument list to go...
    By SMurf in forum C Programming
    Replies: 6
    Last Post: 02-27-2003, 02:02 PM
  5. rerouting variable argument lists...
    By doubleanti in forum C++ Programming
    Replies: 9
    Last Post: 12-14-2001, 09:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21