mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-12-29 10:30:48 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user