I'm having difficulty understanding why my code wouldn't work
on (it seems like) anything other than AIX or NeXT. Here's the
fragment it is having difficulty dealing with:
(from finder.h)
/*-- finder.h begins here */
#define MAXNAME 20
#define MAXHANDLE 25
#define MAXADDRESS 255
#define FINGER 79
#define BUFLEN 65535
#define PACKET 1024
#define TRUE 1
#define FALSE 0
struct buffer_struct
{
char name[MAXNAME];
char handle[MAXHANDLE];
char address[MAXADDRESS];
struct buffer_struct *next;
struct buffer_struct *prev;
short logged;
Quote:};
typedef struct buffer_struct names;
struct login_struct
{
char *login;
struct login_struct *next;
Quote:};
typedef struct login_struct logins;
struct thread_struct
{
names *pointer;
struct thread_struct *next;
Quote:};
typedef struct thread_struct thread;
extern int in_list (char *, logins *); /* CODE DIES HERE */
extern thread *group (names *);
extern void process_group (thread *);
extern logins *grep (char *);
extern names *sort_insert (names *, names *);
extern char *finger (char *);
#ifdef NEEDS_STRDUP
char *strdup (char *);
#endif
/*---end of finder.h---*/
The code always produces a syntax error at the first line
following the thread typedef. This behaviour has been observed
with both SunOS (4.1.2 (?)) on IPC, and DYNIX V3.2.0. Doing
a `lint' on only this code produces many syntax errors. So
does the standard `cc' compilers.
SunOS quit compiling with `too many errors.' Trying it with
Dynix and Ultrix gives similar results.
Now, here's the mystery: when I was writing the code, I worked
mainly with AIX 3.2 and the NeXT. The above code (in fact the
whole program) didn't produce _any_ errors (using standard cc.)
Not even a warning.
Any suggestions ? About five programmers looked at the code
and shrugged, it looks fine to us (and to the AIX and NeXT
compilers.) Of course, we could be overworked, and perhaps
our computers have been turned on for too long.
Regards,
-Ade Barkah.
--
CompuServe: 74160,3404