[PATCH 4/4] psxhdrs/stdio/v*.c: Fix warnings in varargs tests
Joel Sherrill
joel at rtems.org
Fri Mar 22 13:30:12 UTC 2019
---
testsuites/psxtests/psxhdrs/stdio/vdprintf.c | 6 ++++--
testsuites/psxtests/psxhdrs/stdio/vfprintf.c | 6 ++++--
testsuites/psxtests/psxhdrs/stdio/vfscanf.c | 5 +++--
testsuites/psxtests/psxhdrs/stdio/vprintf.c | 5 +++--
testsuites/psxtests/psxhdrs/stdio/vscanf.c | 5 +++--
testsuites/psxtests/psxhdrs/stdio/vsnprintf.c | 5 +++--
testsuites/psxtests/psxhdrs/stdio/vsprintf.c | 5 +++--
testsuites/psxtests/psxhdrs/stdio/vsscanf.c | 5 +++--
8 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/testsuites/psxtests/psxhdrs/stdio/vdprintf.c b/testsuites/psxtests/psxhdrs/stdio/vdprintf.c
index dac5027..43dfa1e 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vdprintf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vdprintf.c
@@ -37,13 +37,15 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
va_list ap;
int result;
+ va_start(ap, arg1);
+
result = vdprintf( 2, "%d", ap );
return result;
diff --git a/testsuites/psxtests/psxhdrs/stdio/vfprintf.c b/testsuites/psxtests/psxhdrs/stdio/vfprintf.c
index 0ad6bcd..3ed24b3 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vfprintf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vfprintf.c
@@ -37,14 +37,16 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
FILE *stream;
va_list ap;
int result;
+ va_start(ap, arg1);
+
stream = fopen( "myfile.dat", "w" );
result = vfprintf( stream, "%d", ap );
diff --git a/testsuites/psxtests/psxhdrs/stdio/vfscanf.c b/testsuites/psxtests/psxhdrs/stdio/vfscanf.c
index 055d462..0c39b34 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vfscanf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vfscanf.c
@@ -37,14 +37,15 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
FILE *stream;
va_list ap;
int result;
+ va_start(ap, arg1);
stream = fopen( "myfile.dat", "w" );
result = vfscanf( stream, " %d %99s ", ap );
diff --git a/testsuites/psxtests/psxhdrs/stdio/vprintf.c b/testsuites/psxtests/psxhdrs/stdio/vprintf.c
index 09b4f8c..cd758cd 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vprintf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vprintf.c
@@ -37,13 +37,14 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
va_list ap;
int result;
+ va_start(ap, arg1);
result = vprintf( " %d %99s ", ap );
return result;
diff --git a/testsuites/psxtests/psxhdrs/stdio/vscanf.c b/testsuites/psxtests/psxhdrs/stdio/vscanf.c
index 5ec0ddd..a39b43a 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vscanf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vscanf.c
@@ -37,13 +37,14 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
va_list ap;
int result;
+ va_start(ap, arg1);
result = vscanf( " %d %99s ", ap );
return result;
diff --git a/testsuites/psxtests/psxhdrs/stdio/vsnprintf.c b/testsuites/psxtests/psxhdrs/stdio/vsnprintf.c
index da5066c..003de41 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vsnprintf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vsnprintf.c
@@ -37,14 +37,15 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
va_list ap;
char string[128];
int result;
+ va_start(ap, arg1);
result = vsnprintf( string, sizeof(string), " %d %99s ", ap );
return result;
diff --git a/testsuites/psxtests/psxhdrs/stdio/vsprintf.c b/testsuites/psxtests/psxhdrs/stdio/vsprintf.c
index d6a5a0f..a57aea8 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vsprintf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vsprintf.c
@@ -37,14 +37,15 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
va_list ap;
char string[128];
int result;
+ va_start(ap, arg1);
result = vsprintf( string, " %d %99s ", ap );
return result;
diff --git a/testsuites/psxtests/psxhdrs/stdio/vsscanf.c b/testsuites/psxtests/psxhdrs/stdio/vsscanf.c
index 0bb9d35..dffcc26 100644
--- a/testsuites/psxtests/psxhdrs/stdio/vsscanf.c
+++ b/testsuites/psxtests/psxhdrs/stdio/vsscanf.c
@@ -37,14 +37,15 @@
#include <stdio.h>
#include <stdarg.h>
-int test( void );
+int test( int arg1, ... );
-int test( void )
+int test( int arg1, ... )
{
char *tokenstring = "15 12 14";
va_list ap;
int result;
+ va_start(ap, arg1);
result = vsscanf( tokenstring, " %d %99s ", ap );
return result;
--
1.8.3.1
More information about the devel
mailing list