4341shn@houxn.UUCP (S.NURENBERG) (08/17/83)
I have a C question. I want to initialize some interrupt
vectors on a M68000 processor card so that when the
one board programmable timer causes an interrupt, it will
be serviced. Below is the current way I do it (which works).
What I want to know is why another way doesn't (see below):
typedef long *P_ADDR;
#define PTMVEC 0x78
main()
{
extern void clock();
P_ADDR *evec_ptr;
evec_ptr = (P_ADDR *) PTMVEC;
*evec_ptr =(P_ADDR) clock;
}
What I want to know is why the following line is syntactically
incorrect (as far as cc says so) but seems to me logically more
correct?
typdef void (*)() P_ADDR;
I appreciate any insight into this problem.
Steven Nurenbeg
houxn!4341shn
gwyn@brl-vld@sri-unix.UUCP (08/18/83)
From: Doug Gwyn (VLD/VMB) <gwyn@brl-vld> If you want P_ADDR to be the type of a pointer to a function returning no value, use typedef void (*P_ADDR)(); The general rule is to put the symbol being declared in its proper context. Some people like this (I do), others hate it. I suggest we do not start flames about this declaration style, since it is a pure matter of taste.