ndd@SUNBAR.MC.DUKE.EDU (Ned Danieley) (12/23/88)
when I compile the following routine using gcc 1.31 on a Sun 3/280
running SunOs 3.5, it complains about 'd' and 'z' being undefined.
running gcc -E shows that gcc has stripped the single quotes from
around d and z. Should this be?
Ned Danieley (ndd@sunbar.mc.duke.edu)
Basic Arrhythmia Laboratory
Box 3140, Duke University Medical Center
Durham, NC 27710
(919) 684-6807 or 684-6942
++++++++++++++++++++ test.c ++++++++++++++++++++++++++++++
#include "sys/ttychars.h"
extern int finish();
extern int suspend();
typedef
struct {
char e_char; /* char to match on */
char e_flags; /* experimental, priviledged */
char *e_help; /* help string */
int (*e_func)(); /* command */
}
esctable_t;
esctable_t etable[] = {
{CTRL(d),NORM, "exit from tip", finish },
{CTRL(z),NORM, "suspend tip", suspend },
{ 0, 0, 0 }
};
++++++++++++++++++++ gcc -E ++++++++++++++++++++++++++++++
# 1 "test.c"
# 1 "/usr/local/lib/gcc-include/sys/ttychars.h"
struct ttychars {
char tc_erase;
char tc_kill;
char tc_intrc;
char tc_quitc;
char tc_startc;
char tc_stopc;
char tc_eofc;
char tc_brkc;
char tc_suspc;
char tc_dsuspc;
char tc_rprntc;
char tc_flushc;
char tc_werasc;
char tc_lnextc;
};
# 1 "test.c"
extern int finish();
extern int suspend();
typedef
struct {
char e_char;
char e_flags;
char *e_help;
int (*e_func)();
}
esctable_t;
esctable_t etable[] = {
{(d&037) ,NORM, "exit from tip", finish },
{(z&037) ,NORM, "suspend tip", suspend },
{ 0, 0, 0 }
};
++++++++++++++++++++ cc -E ++++++++++++++++++++++++++++++
cc -E test.c
# 1 "test.c"
# 1 "/usr/include/sys/ttychars.h" 1
struct ttychars {
char tc_erase;
char tc_kill;
char tc_intrc;
char tc_quitc;
char tc_startc;
char tc_stopc;
char tc_eofc;
char tc_brkc;
char tc_suspc;
char tc_dsuspc;
char tc_rprntc;
char tc_flushc;
char tc_werasc;
char tc_lnextc;
};
# 2 "test.c" 2
extern int finish();
extern int suspend();
typedef
struct {
char e_char;
char e_flags;
char *e_help;
int (*e_func)();
}
esctable_t;
esctable_t etable[] = {
{ ('d'&037),NORM, "exit from tip", finish },
{ ('z'&037),NORM, "suspend tip", suspend },
{ 0, 0, 0 }
};