X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Fstdarg.c;h=abb1f4c4f7478b8208b6074b1ca856c997ea381a;hb=b41576197133c1211d6ec353faf93f505f573b8a;hp=4900cc58de8d607dd7f60af483af575f28677e9d;hpb=d02f38605b53cdff5460cc6b9e1b2a80c3a2ba4c;p=pdclib diff --git a/functions/_PDCLIB/stdarg.c b/functions/_PDCLIB/stdarg.c index 4900cc5..abb1f4c 100644 --- a/functions/_PDCLIB/stdarg.c +++ b/functions/_PDCLIB/stdarg.c @@ -1,7 +1,5 @@ /* $Id$ */ -/* Release $Name$ */ - /* stdarg This file is part of the Public Domain C Library (PDCLib). @@ -11,6 +9,7 @@ #include #include #include +#ifdef TEST #include <_PDCLIB_test.h> @@ -29,6 +28,11 @@ enum tag_t TAG_FUNCPTR }; +static int dummy( void ) +{ + return INT_MAX; +} + static int test( enum tag_t s, ... ) { enum tag_t tag = s; @@ -82,7 +86,9 @@ static int test( enum tag_t s, ... ) } case TAG_FUNCPTR: { - TESTCASE( (va_arg( ap, intfunc_t ))() == INT_MAX ); + intfunc_t function; + TESTCASE( ( function = va_arg( ap, intfunc_t ) ) == dummy ); + TESTCASE( function() == INT_MAX ); tag = va_arg( ap, enum tag_t ); break; } @@ -95,11 +101,6 @@ static int test( enum tag_t s, ... ) } } -static int dummy( void ) -{ - return INT_MAX; -} - int main( void ) { int x = INT_MAX; @@ -111,3 +112,4 @@ int main( void ) test( TAG_INTPTR, &x, TAG_LDBLPTR, &d, TAG_FUNCPTR, dummy, TAG_END ); return TEST_RESULTS; } +#endif