Article View: gnu.g++.bug
Article #1367gcc-2.3.3 error while compiling groff-1.06 lex.cc
From: Eigil Krogh Sorensen
Date: Fri, 08 Jan 1993 13:54
Date: Fri, 08 Jan 1993 13:54
2137 lines
29584 bytes
29584 bytes
Error while compiling groff-1.06.
System:
Motorola sysV68 R3V5.1
Hardware:
mvme147/68030 based (mot3300)
Compiler:
gcc-2.3.3
Program:
Groff-1.06
eqn/lex.cc
---------------------------------------------------------------------
Screen dumps. (vki68 eks $ is prompt).
---------------------------------------------------------------------
-------------------------------------------------------------------
compiler error messages.
------------------------
nice make
Making all in include
Making all in libgroff
Making all in libdriver
Making all in libbib
Making all in groff
Making all in troff
Making all in tbl
Making all in pic
Making all in eqn
gcc -O2 -v -I. -I. -I../include -I./../include -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DLONG_FOR_TIME_T=1 -Dvfork=fork -c lex.cc
Reading specs from /usr/local/lib/gcc-lib/3300/2.3.3/specs
gcc version 2.3.3
/usr/local/lib/gcc-lib/3300/2.3.3/cpp -lang-c++ -v -I. -I. -I../include -I./../include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dm68k -Dunix -DsysV68 -D__m68k__ -D__unix__ -D__sysV68__ -D__m68k -D__unix -D__sysV68 -D__OPTIMIZE__ -D__HAVE_68881__ -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DLONG_FOR_TIME_T=1 -Dvfork=fork lex.cc /usr/tmp/cca07841.i
GNU CPP version 2.3.3 (68k, SGS/AT&T sysV68 syntax)
/usr/local/lib/gcc-lib/3300/2.3.3/cc1plus /usr/tmp/cca07841.i -quiet -dumpbase lex.cc -O2 -version -o /usr/tmp/cca07841.s
GNU C++ version 2.3.3 (68k, SGS/AT&T sysV68 syntax) compiled by GNU C version 2.3.3.
lex.cc: In method `definition::definition ()':
lex.cc:37: class `definition' does not have any field named `contents'
lex.cc: In method `definition::~definition ()':
lex.cc:44: `contents' undeclared (first use this function)
lex.cc:44: (Each undeclared identifier is reported only once
lex.cc:44: for each function it appears in.)
lex.cc:44: type to vector delete is neither pointer or array type
lex.cc: In function `void init_table (const char *)':
lex.cc:256: structure has no member named `tok'
lex.cc:262: structure has no member named `contents'
lex.cc:268: structure has no member named `contents'
lex.cc: In function `int get_token (int (= 0 ))':
lex.cc:787: structure has no member named `contents'
lex.cc:686: too few arguments to function `void interpolate_macro_with_args (const char *)'
lex.cc:787: at this point in file
lex.cc:851: structure has no member named `contents'
lex.cc:856: structure has no member named `tok'
lex.cc:865: warning: control reaches end of non-void function
lex.cc: In function `void do_definition (int)':
lex.cc:910: structure has no member named `contents'
lex.cc:910: type to vector delete is neither pointer or array type
lex.cc:915: structure has no member named `contents'
*** Error code 1
Stop.
*** Error code 1
Stop.
*** Error code 1
Stop.
--------------------------------------------------------------------
cpp output.
-----------
vki68 eks $ pwd
/usr/eks/gnu/ftp.denet.dk/groff-1.06/groff-1.06/eqn
vki68 eks $ gcc -v -O2 -E -I../include -o lex.E lex.cc
Reading specs from /usr/local/lib/gcc-lib/3300/2.3.3/specs
gcc version 2.3.3
/usr/local/lib/gcc-lib/3300/2.3.3/cpp -lang-c++ -v -I../include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dm68k -Dunix -DsysV68 -D__m68k__ -D__unix__ -D__sysV68__ -D__m68k -D__unix -D__sysV68 -D__OPTIMIZE__ -D__HAVE_68881__ lex.cc -o lex.E
GNU CPP version 2.3.3 (68k, SGS/AT&T sysV68 syntax)
vki68 eks $
vki68 eks $
vki68 eks $ cat lex.E
# 1 "lex.cc"
# 1 "eqn.h" 1
# 1 "/usr/local/lib/g++-include/stdio.h" 1 3
#pragma interface
# 1 "/usr/local/lib/g++-include/_G_config.h" 1 3
typedef int _G_clock_t;
typedef short _G_dev_t;
typedef long _G_fpos_t;
typedef int _G_gid_t;
typedef unsigned short _G_ino_t;
typedef int _G_mode_t;
typedef int _G_nlink_t;
typedef long _G_off_t;
typedef int _G_pid_t;
typedef long int _G_ptrdiff_t;
typedef int _G_sigset_t;
typedef unsigned int _G_size_t;
typedef long _G_time_t;
typedef int _G_uid_t;
typedef long int _G_wchar_t;
typedef int _G_ssize_t;
typedef void * _G_va_list;
# 33 "/usr/local/lib/g++-include/stdio.h" 2 3
extern "C" {
# 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdio.h" 1 3
# 1 "/usr/local/lib/g++-include/stdarg.h" 1 3
extern "C" {
# 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 1 3
typedef void *__gnuc_va_list;
# 85 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 3
# 137 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 3
# 2 "/usr/local/lib/g++-include/stdarg.h" 2 3
}
# 2 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdio.h" 2 3
#ident "@(#)stdio.h 35.2"
typedef struct {
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
char _flag;
char _file;
} FILE;
extern FILE _iob[80 ];
extern FILE *__hide_fopen (), *__hide_fdopen (), *__hide_freopen (), *__hide_popen (), *tmpfile();
extern long __hide_ftell ();
extern void __hide_rewind (), __hide_setbuf ();
extern char *ctermid(), *cuserid(), *fgets(), *gets(), *__hide_tempnam (), *tmpnam();
extern unsigned char *_bufendtab[];
extern int fclose(), fflush(), __hide_fread (), __hide_fwrite (), fseek(), fgetc(),
getw(), pclose(), __hide_printf (), __hide_fprintf (), __hide_sprintf (),
__hide_vprintf (), __hide_vfprintf (), __hide_vsprintf (), fputc(), __hide_putw (),
__hide_puts (), __hide_fputs (), __hide_scanf (), __hide_fscanf (), __hide_sscanf (),
__hide_setvbuf (), system(), ungetc();
# 69 "/usr/local/lib/g++-include/stdio.h" 2 3
}
extern "C" {
int fclose(FILE*);
FILE* fdopen(int, const char*);
int fflush(FILE*);
int fgetc(FILE*);
char* fgets(char*, int, FILE *);
FILE* fopen(const char*, const char*);
int fprintf(FILE*, const char* ...);
int fputc(int, FILE*);
int fputs(const char*, FILE*);
_G_size_t fread(void*, _G_size_t , _G_size_t , FILE*);
FILE* freopen(const char*, const char*, FILE*);
int fscanf(FILE*, const char* ...);
int fseek(FILE*, long, int);
long ftell(FILE *);
_G_size_t fwrite(const void*, _G_size_t , _G_size_t , FILE*);
char* gets(char*);
int getw(FILE*);
int pclose(FILE*);
void perror(const char*);
FILE* popen(const char*, const char*);
int printf(const char* ...);
int puts(const char*);
int putw(int, FILE*);
int rewind(FILE*);
int scanf(const char* ...);
void setbuf(FILE*, char*);
void setbuffer(FILE*, char*, int);
int setlinebuf(FILE*);
int setvbuf(FILE*, char*, int, _G_size_t );
int sscanf(char*, const char* ...);
FILE* tmpfile();
int ungetc(int, FILE*);
int vfprintf (...) ;
int vprintf (...) ;
int sprintf (...) ;
int vsprintf (...) ;
extern int _filbuf (...) ;
extern int _flsbuf (...) ;
}
# 21 "eqn.h" 2
# 1 "/usr/local/lib/g++-include/string.h" 1 3
extern "C" {
char* strcat(char*, const char*);
char* strchr(const char*, int);
int strcmp(const char*, const char*);
int strcoll(const char*, const char*);
char* strcpy(char*, const char*);
_G_size_t strcspn(const char*, const char*);
char* strdup(const char*);
_G_size_t strlen(const char*);
char* strncat(char*, const char*, _G_size_t );
int strncmp(const char*, const char*, _G_size_t );
char* strncpy(char*, const char*, _G_size_t );
char* strpbrk(const char*, const char*);
char* strrchr(const char*, int);
_G_size_t strspn(const char*, const char*);
char* strstr(const char*, const char *);
char* strtok(char*, const char*);
_G_size_t strxfrm(char*, const char*, _G_size_t );
char* index(const char*, int);
char* rindex(const char*, int);
}
# 1 "/usr/local/lib/g++-include/memory.h" 1 3
# 1 "/usr/local/lib/g++-include/stddef.h" 1 3
extern "C" {
# 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 1 3
# 43 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 3
typedef long int ptrdiff_t;
typedef unsigned int _G_size_t ;
typedef __wchar_t wchar_t;
# 179 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 3
# 7 "/usr/local/lib/g++-include/stddef.h" 2 3
}
# 6 "/usr/local/lib/g++-include/memory.h" 2 3
extern "C" {
void* memalign (...) ;
void* memccpy (...) ;
void* memchr (...) ;
int memcmp (...) ;
void* memcpy (...) ;
void* memmove (...) ;
void* memset (...) ;
int ffs (...) ;
_G_size_t getpagesize (...) ;
void* valloc (...) ;
void bcopy (...) ;
int bcmp (...) ;
void bzero (...) ;
}
# 43 "/usr/local/lib/g++-include/string.h" 2 3
# 22 "eqn.h" 2
# 1 "../include/assert.h" 1
volatile
void assertion_failed(int, const char *);
inline void do_assert(int expr, int line, const char *file)
{
if (!expr)
assertion_failed(line, file);
}
# 23 "eqn.h" 2
# 1 "/usr/local/lib/g++-include/stdlib.h" 1 3
extern "C" {
int abs(int);
void volatile abort(void);
double atof(const char*);
int atoi(const char*);
long atol(const char*);
int atexit(auto void (*p) (void));
int bsearch (const void *, const void *, _G_size_t ,
_G_size_t , auto int (*ptf)(const void*, const void*));
void* calloc(_G_size_t , _G_size_t );
void cfree(void*);
void volatile exit(int);
char* fcvt(double, int, int*, int*);
void free(void*);
char* getenv(const char*);
int getopt(int, char * const *, const char*);
int getpw(int, char*);
char* gcvt(double, int, char*);
char* ecvt(double, int, int*, int*);
extern char** environ;
long labs(long);
void* malloc(_G_size_t );
_G_size_t malloc_usable_size(void*);
int putenv(const char*);
extern char* optarg;
extern int opterr;
extern int optind;
void qsort(void*, _G_size_t , _G_size_t , auto int (*ptf)(void*,void*));
int rand(void);
void* realloc(void*, _G_size_t );
int setkey(const char*);
int srand(unsigned int);
double strtod(const char*, char**);
long strtol(const char*, char**, int);
unsigned long stroul(const char**, int);
int system(const char*);
long random(void);
void srandom(int);
char* setstate(char*);
char* initstate(unsigned, char*, int);
double drand48(void);
void lcong48(short*);
long jrand48(short*);
long lrand48(void);
long mrand48(void);
long nrand48(short*);
short* seed48(short*);
void srand48(long);
char* ctermid(char*);
char* cuserid(char*);
char* tempnam(const char*, const char*);
char* tmpnam(char*);
}
# 24 "eqn.h" 2
# 1 "/usr/local/lib/g++-include/errno.h" 1 3
extern "C" {
# 1 "/usr/include/errno.h" 1 3
# 1 "/usr/include/sys/errno.h" 1 3
#ident "@(#)kern-port:sys/errno.h 35.2"
# 7 "/usr/include/errno.h" 2 3
extern int errno;
# 9 "/usr/local/lib/g++-include/errno.h" 2 3
extern char* sys_errlist[];
extern int sys_nerr;
extern int errno;
void perror(const char*);
char* strerr(int);
}
# 25 "eqn.h" 2
# 1 "../include/cset.h" 1
enum cset_builtin { CSET_BUILTIN };
class cset {
public:
cset();
cset(cset_builtin);
cset(const char *);
cset(const unsigned char *);
int operator()(unsigned char) const;
cset &operator|=(const cset &);
cset &operator|=(unsigned char);
friend class cset_init;
private:
char v[255 +1];
void clear();
};
inline int cset::operator()(unsigned char c) const
{
return v[c];
}
inline cset &cset::operator|=(unsigned char c)
{
v[c] = 1;
return *this;
}
extern cset csalpha;
extern cset csupper;
extern cset cslower;
extern cset csdigit;
extern cset csxdigit;
extern cset csspace;
extern cset cspunct;
extern cset csalnum;
extern cset csprint;
extern cset csgraph;
extern cset cscntrl;
static class cset_init {
static int initialised;
public:
cset_init();
} _cset_init;
# 26 "eqn.h" 2
# 1 "../include/errarg.h" 1
class errarg {
enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type;
const char *s;
int n;
char c;
double d;
public:
errarg();
errarg(const char *);
errarg(char);
errarg(unsigned char);
errarg(int);
errarg(double);
int empty() const;
void print() const;
};
extern errarg empty_errarg;
extern void errprint(const char *,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
# 27 "eqn.h" 2
# 1 "../include/error.h" 1
extern void fatal_with_file_and_line(const char *filename, int lineno,
const char *format,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern void error_with_file_and_line(const char *filename, int lineno,
const char *format,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern void warning_with_file_and_line(const char *filename, int lineno,
const char *format,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern void fatal(const char *,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern void error(const char *,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern void warning(const char *,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
extern const char *program_name;
extern int current_lineno;
extern const char *current_filename;
# 28 "eqn.h" 2
# 1 "../include/lib.h" 1
extern "C" {
char *strerror(int);
const char *itoa(int);
const char *iftoa(int, int);
};
extern "C" {
int getopt(int, const char **, const char *);
extern char *optarg;
extern int optind;
extern int opterr;
}
char *strsave(const char *s);
int is_prime(unsigned);
# 1 "/usr/local/lib/g++-include/stdio.h" 1 3
# 174 "/usr/local/lib/g++-include/stdio.h" 3
# 41 "../include/lib.h" 2
FILE *xtmpfile();
int interpret_lf_args(const char *p);
extern char illegal_char_table[];
inline int illegal_input_char(int c)
{
return c >= 0 && illegal_char_table[c];
}
# 29 "eqn.h" 2
# 1 "box.h" 1
struct list_box;
class box {
private:
static int next_uid;
public:
int spacing_type;
const int uid;
box();
virtual void debug_print() = 0;
virtual ~box();
void top_level();
virtual int compute_metrics(int);
virtual void compute_subscript_kern();
virtual void compute_skew();
virtual void output();
void extra_space();
virtual list_box *to_list_box();
virtual int is_simple();
virtual int is_char();
virtual int left_is_italic();
virtual int right_is_italic();
virtual void handle_char_type(int, int);
enum { FOUND_NOTHING = 0, FOUND_MARK = 1, FOUND_LINEUP = 2 };
void set_spacing_type(char *type);
virtual void hint(unsigned);
virtual void check_tabs(int);
};
class box_list {
private:
int maxlen;
public:
box **p;
int len;
box_list(box *);
~box_list();
void append(box *);
void list_check_tabs(int);
void list_debug_print(const char *sep);
friend class list_box;
};
class list_box : public box {
int is_script;
box_list list;
int sty;
public:
list_box(box *);
void debug_print();
int compute_metrics(int);
void compute_subscript_kern();
void output();
void check_tabs(int);
void append(box *);
list_box *to_list_box();
void handle_char_type(int, int);
void compute_sublist_width(int n);
friend box *make_script_box(box *, box *, box *);
friend box *make_mark_box(box *);
friend box *make_lineup_box(box *);
};
enum alignment { LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN };
class column : public box_list {
alignment align;
int space;
public:
column(box *);
void set_alignment(alignment);
void set_space(int);
void debug_print(const char *);
friend class matrix_box;
friend class pile_box;
};
class pile_box : public box {
column col;
public:
pile_box(box *);
int compute_metrics(int);
void output();
void debug_print();
void check_tabs(int);
void set_alignment(alignment a) { col.set_alignment(a); }
void set_space(int n) { col.set_space(n); }
void append(box *p) { col.append(p); }
};
class matrix_box : public box {
private:
int len;
int maxlen;
column **p;
public:
matrix_box(column *);
~matrix_box();
void append(column *);
int compute_metrics(int);
void output();
void check_tabs(int);
void debug_print();
};
class pointer_box : public box {
protected:
box *p;
public:
pointer_box(box *);
~pointer_box();
int compute_metrics(int);
void compute_subscript_kern();
void compute_skew();
void debug_print() = 0;
void check_tabs(int);
};
class vcenter_box : public pointer_box {
public:
vcenter_box(box *);
int compute_metrics(int);
void output();
void debug_print();
};
class simple_box : public box {
public:
int compute_metrics(int);
void compute_subscript_kern();
void compute_skew();
void output() = 0;
void debug_print() = 0;
int is_simple();
};
class quoted_text_box : public simple_box {
char *text;
public:
quoted_text_box(char *);
~quoted_text_box();
void debug_print();
void output();
};
class half_space_box : public simple_box {
public:
half_space_box();
void output();
void debug_print();
};
class space_box : public simple_box {
public:
space_box();
void output();
void debug_print();
};
class tab_box : public box {
int disabled;
public:
tab_box();
void output();
void debug_print();
void check_tabs(int);
};
class size_box : public pointer_box {
private:
char *size;
public:
size_box(char *, box *);
~size_box();
int compute_metrics(int);
void output();
void debug_print();
};
class font_box : public pointer_box {
private:
char *f;
public:
font_box(char *, box *);
~font_box();
int compute_metrics(int);
void output();
void debug_print();
};
class fat_box : public pointer_box {
public:
fat_box(box *);
int compute_metrics(int);
void output();
void debug_print();
};
class vmotion_box : public pointer_box {
private:
int n;
public:
vmotion_box(int, box *);
int compute_metrics(int);
void output();
void debug_print();
};
class hmotion_box : public pointer_box {
int n;
public:
hmotion_box(int, box *);
int compute_metrics(int);
void output();
void debug_print();
};
box *split_text(char *);
box *make_script_box(box *, box *, box *);
box *make_mark_box(box *);
box *make_lineup_box(box *);
box *make_delim_box(char *, box *, char *);
box *make_sqrt_box(box *);
box *make_prime_box(box *);
box *make_over_box(box *, box *);
box *make_small_over_box(box *, box *);
box *make_limit_box(box *, box *, box *);
box *make_accent_box(box *, box *);
box *make_uaccent_box(box *, box *);
box *make_overline_box(box *);
box *make_underline_box(box *);
box *make_special_box(char *, box *);
void set_space(int);
void set_gsize(const char *);
void set_gfont(const char *);
void set_grfont(const char *);
void set_gbfont(const char *);
const char *get_gfont();
const char *get_grfont();
const char *get_gbfont();
void start_string();
void output_string();
void do_text(const char *);
void restore_compatibility();
void set_script_reduction(int n);
void set_minimum_size(int n);
void set_param(const char *name, int value);
void set_char_type(const char *type, char *ch);
void init_char_table();
void init_extensible();
void define_extensible(const char *name, const char *ext, const char *top = 0,
const char *mid = 0, const char *bot = 0);
# 31 "eqn.h" 2
extern char start_delim;
extern char end_delim;
extern int non_empty_flag;
extern int inline_flag;
extern int draw_flag;
extern int one_size_reduction_flag;
extern int compatible_flag;
void init_lex(const char *str, const char *filename, int lineno);
void lex_error(const char *message,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
void init_table(const char *device);
# 21 "lex.cc" 2
# 1 "eqn.tab.h" 1
typedef union {
char *str;
box *b;
pile_box *pb;
matrix_box *mb;
int n;
column *col;
} YYSTYPE;
extern YYSTYPE yylval;
# 22 "lex.cc" 2
# 1 "../include/stringclass.h" 1
# 1 "/usr/local/lib/g++-include/stdio.h" 1 3
# 174 "/usr/local/lib/g++-include/stdio.h" 3
# 22 "../include/stringclass.h" 2
# 1 "../include/assert.h" 1
# 33 "../include/assert.h"
# 23 "../include/stringclass.h" 2
class string {
public:
string();
string(const string &);
string(const char *);
string(const char *, int);
string(char);
~string();
string &operator=(const string &);
string &operator=(const char *);
string &operator=(char);
string &operator+=(const string &);
string &operator+=(const char *);
string &operator+=(char);
void append(const char *, int);
int length() const;
int empty() const;
int operator*() const;
string substring(int i, int n) const;
char &operator[](int);
char operator[](int) const;
void set_length(int i);
const char *contents() const;
int search(char) const;
char *extract() const;
void clear();
void move(string &);
friend string operator+(const string &, const string &);
friend string operator+(const string &, const char *);
friend string operator+(const char *, const string &);
friend string operator+(const string &, char);
friend string operator+(char, const string &);
friend int operator==(const string &, const string &);
friend int operator!=(const string &, const string &);
friend int operator<=(const string &, const string &);
friend int operator<(const string &, const string &);
friend int operator>=(const string &, const string &);
friend int operator>(const string &, const string &);
private:
char *ptr;
int len;
int sz;
string(const char *, int, const char *, int);
void grow1();
};
inline char &string::operator[](int i)
{
do_assert(i >= 0 && i < len, 85, "../include/stringclass.h") ;
return ptr[i];
}
inline char string::operator[](int i) const
{
do_assert(i >= 0 && i < len, 91, "../include/stringclass.h") ;
return ptr[i];
}
inline int string::length() const
{
return len;
}
inline int string::empty() const
{
return len == 0;
}
inline int string::operator*() const
{
return len;
}
inline const char *string::contents() const
{
return ptr;
}
inline string operator+(const string &s1, const string &s2)
{
return string(s1.ptr, s1.len, s2.ptr, s2.len);
}
inline string operator+(const string &s1, const char *s2)
{
if (s2 == 0)
return s1;
else
return string(s1.ptr, s1.len, s2, strlen(s2));
}
inline string operator+(const char *s1, const string &s2)
{
if (s1 == 0)
return s2;
else
return string(s1, strlen(s1), s2.ptr, s2.len);
}
inline string operator+(const string &s, char c)
{
return string(s.ptr, s.len, &c, 1);
}
inline string operator+(char c, const string &s)
{
return string(&c, 1, s.ptr, s.len);
}
inline int operator==(const string &s1, const string &s2)
{
return (s1.len == s2.len
&& (s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) == 0));
}
inline int operator!=(const string &s1, const string &s2)
{
return (s1.len != s2.len
|| (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0));
}
inline string string::substring(int i, int n) const
{
do_assert(i >= 0 && i + n <= len, 160, "../include/stringclass.h") ;
return string(ptr + i, n);
}
inline string &string::operator+=(char c)
{
if (len >= sz)
grow1();
ptr[len++] = c;
return *this;
}
void put_string(const string &, FILE *);
string as_string(int);
# 23 "lex.cc" 2
# 1 "../include/ptable.h" 1
# 1 "../include/assert.h" 1
# 33 "../include/assert.h"
# 21 "../include/ptable.h" 2
extern unsigned next_ptable_size(unsigned);
extern unsigned long hash_string(const char *);
# 68 "../include/ptable.h"
# 166 "../include/ptable.h"
# 24 "lex.cc" 2
struct definition {
char is_macro;
char is_simple;
union {
int tok;
char *contents;
};
definition();
~definition();
};
definition::definition() : is_macro(1), contents(0), is_simple(0)
{
}
definition::~definition()
{
if (is_macro)
delete [] contents;
}
struct definition_passoc { char *key; definition *val; definition_passoc (); }; struct definition_ptable ; class definition_ptable_iterator { definition_ptable *p; unsigned i; public: definition_ptable_iterator (definition_ptable *); int next(const char **, definition **); }; class definition_ptable { definition_passoc *v; unsigned size; unsigned used; enum { FULL_NUM = 2, FULL_DEN = 3, INITIAL_SIZE = 17 }; public: definition_ptab
le (); ~definition_ptable (); void define(const char *, definition *); definition *lookup(const char *); friend class definition_ptable_iterator ; };
Technical Details
Message-ID:
<m0nAL6V-0001YPC@vki68.aar-vki.dk>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!vki68.aar-vki.DK!eksShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!vki68.aar-vki.DK!eks From: eks@vki68.aar-vki.DK (Eigil Krogh Sorensen) Subject: gcc-2.3.3 error while compiling groff-1.06 lex.cc Message-ID: <m0nAL6V-0001YPC@vki68.aar-vki.dk> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Fri, 8 Jan 1993 13:54:28 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 2137