Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9022043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:24:16+00:00 2026-06-16T05:24:16+00:00

Does Visual C++ have something similar to __builtin_va_arg_pack ? This built-in function represents all

  • 0

Does Visual C++ have something similar to __builtin_va_arg_pack?

This built-in function represents all anonymous arguments of an inline
function. It can be used only in inline functions which will be always
inlined, never compiled as a separate function, such as those using
attribute ((always_inline)) or attribute ((gnu_inline)) extern inline functions. It must be only passed as
last argument to some other function with variable arguments. This is
useful for writing small wrapper inlines for variable argument
functions, when using preprocessor macros is undesirable. For example:

      extern int myprintf (FILE *f, const char *format, ...);
      extern inline __attribute__ ((__gnu_inline__)) int
      myprintf (FILE *f, const char *format, ...)
      {
        int r = fprintf (f, "myprintf: ");
        if (r < 0)
          return r;
        int s = fprintf (f, format, __builtin_va_arg_pack ());
        if (s < 0)
          return s;
        return r + s;
      }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:24:17+00:00Added an answer on June 16, 2026 at 5:24 am

    Not that I know of. But there’s no need to use a gcc extension here, use vfprintf instead:

      int myprintf (FILE *f, const char *format, ...)
      {
        va_list ap;
        va_start(ap, format);
        int r = fprintf (f, "myprintf: ");
        if (r < 0)
          return r;
        int s = vfprintf (f, format, ap);
        va_end(ap);
        if (s < 0)
          return s;
        return r + s;
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Visual Studio 2008 C++ application that does something like this: template<
I have successfully constructed something similar to the following code in visual studio 2008:
I have something similar to this in my code: #include <iostream> #include <cstdlib> struct
How does visual studio link files to their corresponding designer.cs files? I have a
Does Eclipse have an analog to Visual Studio's Immediate Window, a window where I
Does anybody have an example of working with database using Visual C++ and OLEDB?
My installation of Visual Studio Team System 2008 (Development Edition) does not have it.
Does Visual Studio .NET 2008 come with UISpy? I ask this for for the
Does Visual Studio / Resharper support this? By refactor copy I mean to be
Visual Studio has a way to import, export your color settings. Does Eclipse have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.