Revert "function pointer compare"

Always fine to try out things but not everything must be shown
to the public. ;)

Also, AFAIK pointers must compare equal only if derived directly
from each other (for example by cast to void* and back).

This reverts commit 8f9bf3f223.
This commit is contained in:
grischka
2020-10-03 09:26:12 +02:00
parent cdc3df949b
commit 40395511d7
3 changed files with 2 additions and 32 deletions

View File

@@ -12,18 +12,10 @@ int (*f)(int) = &fred;
(fprint here) must not be called directly anywhere in the test. */
int (*fprintfptr)(FILE *, const char *, ...) = &fprintf;
typedef int (*func) (int);
static int dummy1(int i) { return 0; }
int dummy2(int i) { return 0; }
static func allfunc[] = { putchar, dummy1, dummy2 };
int main()
{
fprintfptr(stdout, "%d\n", (*f)(24));
printf ("%d\n", allfunc[0] == putchar);
printf ("%d\n", allfunc[1] == dummy1);
printf ("%d\n", allfunc[2] == dummy2);
return 0;
}