Fixed the bug that redefined macros could co-exist but not all be undefined with a single #undef.

This commit is contained in:
acqn
2022-08-06 18:21:42 +08:00
parent b93f9fbba4
commit ae811baaf1
2 changed files with 155 additions and 126 deletions

25
test/val/bug1822-pptest.c Normal file
View File

@@ -0,0 +1,25 @@
/* Bug #1822 - Redefined macros failed to be all undefined with a single #undef */
#undef F
#undef F
#define F 1
#define F 1
#undef F
#if defined F
#error #undef F fails!
#endif
#define F 0
#include <stdio.h>
int main(void)
{
if (F != 0)
{
printf("failed: F = %d\n", F);
}
return F;
}