From 62c22e55e704edd4cd5fdb0b95eb9f9f79bc37fe Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 8 Mar 2021 18:34:07 +0100 Subject: Attempts at conversion of va_list --- tests/ref15.txt | 1 + tests/test15 | Bin 0 -> 19664 bytes tests/test15.c | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/ref15.txt create mode 100755 tests/test15 create mode 100644 tests/test15.c (limited to 'tests') diff --git a/tests/ref15.txt b/tests/ref15.txt new file mode 100644 index 00000000..b2bb8503 --- /dev/null +++ b/tests/ref15.txt @@ -0,0 +1 @@ +Hello x86_64 World, pi=3.14159! diff --git a/tests/test15 b/tests/test15 new file mode 100755 index 00000000..b2bd8836 Binary files /dev/null and b/tests/test15 differ diff --git a/tests/test15.c b/tests/test15.c new file mode 100644 index 00000000..b00c7171 --- /dev/null +++ b/tests/test15.c @@ -0,0 +1,24 @@ +#include +#include + +int my_func(const char* fmt, va_list a) +{ + return vprintf(fmt, a); +} + +int my_func1(const char* fmt, ...) +{ + va_list args; + va_start(args, fmt); + int ret = my_func(fmt, args); + va_end(args); + return ret; +} + +int main(int argc, char **argv) +{ + int ret = my_func1("Hello %s World, pi=%g!\n", "x86_64", 3.14159265); + return 0; +} + + -- cgit 1.4.1