Add a specific test for old C89 features that were removed from C99+.

This commit is contained in:
Stephen Heumann 2022-10-16 21:27:41 -05:00
parent afe40c0f67
commit b3c30b05d8
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,4 @@
{1} c89oldfeat.c
{1} c95digraph.c
{1} c95iso646.c
{1} c99fam.c

View File

@ -0,0 +1,31 @@
/*
* Test old features from C89/C90 that have been removed or deprecated in C99+.
*/
int printf(const char *, ...);
#define M+4 /* no whitespace after macro name */
main () /* implicit int, no prototypes */
{
auto i,j; /* implicit int */
j = M;
i = (const) j; /* implicit int */
i = (volatile) j;
if (f(i) == 8) /* calling undeclared function */
{
printf ("Passed Conformance Test c89oldfeat\n");
return 0;
};
printf ("Failed Conformance Test c89oldfeat\n");
return; /* return no value from a function returning int */
}
f(x) /* implicit int, no prototypes */
/* implicit int parameter x */
{
return x * 2;
}