Article View: gnu.gcc.bug
Article #2081possible bug in gcc 1.31
From: Ned Danieley
Date: Fri, 23 Dec 1988 15:46
Date: Fri, 23 Dec 1988 15:46
118 lines
2735 bytes
2735 bytes
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 }
};
Technical Details
Message-ID:
<8812231546.AA18402@sunbar.mc.duke.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!osu-cis!tut.cis.ohio-state.edu!SUNBAR.MC.DUKE.EDU!nddShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!osu-cis!tut.cis.ohio-state.edu!SUNBAR.MC.DUKE.EDU!ndd From: ndd@SUNBAR.MC.DUKE.EDU (Ned Danieley) Newsgroups: gnu.gcc.bug Subject: possible bug in gcc 1.31 Message-ID: <8812231546.AA18402@sunbar.mc.duke.edu> Date: 23 Dec 88 15:46:21 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 117