Skip to main content
Advice
0 votes
6 replies
229 views

Is there any limitations to pass the number of arguments to a variadic function? for example: CString command; command.Format(_T("My name is %s. im %d years old. my luck number is %d, I like %s&...
somasundaram2004's user avatar
4 votes
3 answers
168 views

I've found that there are conditions that the second argument of va_start(ap, last) must satisfy, which are: last must not be a register variable last must not be a function last must not be an array ...
Doohyeon Won's user avatar
-4 votes
1 answer
93 views

I'm experimenting a bit with trying to build NodeJS 24.11.1 with GCC 13.4.0 on an older OS X system, mostly as a can-it-be-done project. Regardless of the reasons, among the hurdles that could be ...
RJVB's user avatar
  • 820
Best practices
0 votes
15 replies
215 views

man stdarg shows, under the va_args macro description: If ap is passed to a function that uses va_arg(ap,type), then the value of ap is undefined after the return of that function. If we look at ...
m0d1nst4ll3r's user avatar
0 votes
1 answer
38 views

I couldn't find exactly my scenario in other questions, please redirect me if you see fit but: I have a function with args with variable length, which i check inside and take different actions based ...
meerkatUI's user avatar
15 votes
3 answers
2k views

I have a very simple C program where I am printing variables of different sizes. #include <stdio.h> unsigned int long long a; unsigned int c; int main() { a = 0x1111111122222222; c = ...
Krishna's user avatar
  • 1,632
3 votes
3 answers
486 views

Here is the variadic example: https://en.cppreference.com/w/c/variadic.html I want to define two functions but I don't know how to do it correctly. The "foo" function should accept "...
stackbiz's user avatar
  • 1,914
10 votes
2 answers
124 views

I was going through the System V AMD64 ABI and couldn’t find a clear explanation for why the AL field (which tracks how many floating-point registers are used) is necessary. From my understanding, ...
OODAX's user avatar
  • 159
0 votes
1 answer
252 views

I have a C function that uses va_list but needs to skip the first two arguments in here: static size_t event_type_CURSOR_POS__weight( const void * self, va_list * app ) { (void) va_arg( *app, ...
Sam's user avatar
  • 119
1 vote
4 answers
217 views

Due to templates being templates, they need to be defined in a header file (making explicit instantiations is not an option). I have an extern function which takes an expanded template parameter pack: ...
 sentientbottleofwine's user avatar
2 votes
1 answer
178 views

I am just wondering why the following code by using va_start, the addresses of the stack parameters are not in order anymore. va_start is a gcc builtin. But how can it change the addresses of the ...
user14825657's user avatar
1 vote
2 answers
147 views

So I was trying to come up with a way to split a given parameter pack args... into two separate packs args1... and args2... (at some specified index, 3 in this case). I also wanted to minimize the ...
Orbit's user avatar
  • 23
3 votes
3 answers
274 views

I know that we can do more arguments than placeholders when using printf, in which case, the excessive arguments are simply ignored: printf("%s", "Hello friend!\n", "Long time ...
PkDrew's user avatar
  • 2,301
3 votes
0 answers
102 views

Assume there is a base class in a Java library which cannot be modified public class BaseClass { public Something function(int... args){ ... } } Typically, this would be overridden in Scala by ...
Ian Bertolacci's user avatar
4 votes
1 answer
180 views

TL;DR: is C23's universal initialization type var = {}; safe for all types, including standard opaque ones, such as va_list? I have code that uses variable arguments. An older version of a static ...
Grigory Rechistov's user avatar

15 30 50 per page
1
2 3 4 5
183