Package: wipl
Severity: normal
Tags: patch
When building 'wipl' on amd64 with gcc-4.0,
I get the following error:
wipld.cc: In member function 'virtual ParseProgram::types
CardCollect::getSymbol(char*, void*&)':
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tMAC' is inaccessible
wipld.cc:77: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tMAC' is inaccessible
wipld.cc:78: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tIP' is inaccessible
wipld.cc:79: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tIP' is inaccessible
wipld.cc:80: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tINT32' is inaccessible
wipld.cc:81: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tINT32' is inaccessible
wipld.cc:82: error: within this context
parseprg.h:15: error: 'ParseProgram::types ParseProgram::tINT32' is inaccessible
wipld.cc:83: error: within this context
make[2]: *** [wipld.o] Error 1
make[2]: Leaving directory `/wipl-20020601/src'
With the attached patch 'wipl' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/wipl-20020601/src/parseprg-internal.h
./src/parseprg-internal.h
--- ../tmp-orig/wipl-20020601/src/parseprg-internal.h 2002-01-01
14:20:28.000000000 +0100
+++ ./src/parseprg-internal.h 2005-02-13 11:44:46.049910424 +0100
@@ -123,7 +123,7 @@
struct SymEntry {
char name[maxsymlen+1]; // Name of variabel
int valid; // True if the variabel is valid.
- ParseProgram::types type; // Type of variabel
+ ParseProgram_types type; // Type of variabel
valueu value; // Location of variabel
};
@@ -138,7 +138,7 @@
// Sets the type and location af a symbol made with createSymbol.
// The function also allocates a memory location for the symbol and
// sets its contest to 0.
- void setType(SymEntry* se, ParseProgram::types type);
+ void setType(SymEntry* se, ParseProgram_types type);
private:
diff -urN ../tmp-orig/wipl-20020601/src/parseprg-lex.ll ./src/parseprg-lex.ll
--- ../tmp-orig/wipl-20020601/src/parseprg-lex.ll 2005-02-13
11:46:42.514407754 +0100
+++ ./src/parseprg-lex.ll 2005-02-13 11:46:36.326603334 +0100
@@ -108,14 +108,14 @@
{IDENT} { // See if the user has suplied this symbol:
void* v;
- ParseProgram::types t=ParseProgram::instance->getSymbol(yytext,v);
- if(t!=ParseProgram::tUNKNOWN) {
+ ParseProgram_types t=ParseProgram::instance->getSymbol(yytext,v);
+ if(t!=tUNKNOWN) {
switch(t) {
- case ParseProgram::tINT64: yylval.nint64var=new
VariabelInt64((int64*)v); return INT64VAR;
- case ParseProgram::tBOOL: yylval.nboolvar=new
VariabelBool((Bool*)v); return BOOLVAR;
- case ParseProgram::tMAC: yylval.nmacvar=new
VariabelMac((mac_addr*)v); return MACVAR;
- case ParseProgram::tIP: yylval.nipvar=new
VariabelIp((ip_addr*)v); return IPVAR;
- case ParseProgram::tINT32: yylval.nint64expr=new
IntToInt64Expr((int*)v); return INT64EXPR;
+ case tINT64: yylval.nint64var=new VariabelInt64((int64*)v);
return INT64VAR;
+ case tBOOL: yylval.nboolvar=new VariabelBool((Bool*)v);
return BOOLVAR;
+ case tMAC: yylval.nmacvar=new VariabelMac((mac_addr*)v);
return MACVAR;
+ case tIP: yylval.nipvar=new VariabelIp((ip_addr*)v);
return IPVAR;
+ case tINT32: yylval.nint64expr=new IntToInt64Expr((int*)v);
return INT64EXPR;
}
assert(0);
}
@@ -124,10 +124,10 @@
Symtable::SymEntry* se=symtabel.getSymbol(yytext);
if(se) {
switch(se->type) {
- case ParseProgram::tINT64:
yylval.nint64var=se->value.int64_value; return INT64VAR;
- case ParseProgram::tBOOL: yylval.nboolvar=se->value.bool_value;
return BOOLVAR;
- case ParseProgram::tMAC: yylval.nmacvar=se->value.mac_value;
return MACVAR;
- case ParseProgram::tIP: yylval.nipvar=se->value.ip_value;
return IPVAR;
+ case tINT64: yylval.nint64var=se->value.int64_value; return
INT64VAR;
+ case tBOOL: yylval.nboolvar=se->value.bool_value; return
BOOLVAR;
+ case tMAC: yylval.nmacvar=se->value.mac_value; return MACVAR;
+ case tIP: yylval.nipvar=se->value.ip_value; return IPVAR;
}
assert(0);
}
diff -urN ../tmp-orig/wipl-20020601/src/parseprg-yacc.yy ./src/parseprg-yacc.yy
--- ../tmp-orig/wipl-20020601/src/parseprg-yacc.yy 2002-01-02
13:54:25.000000000 +0100
+++ ./src/parseprg-yacc.yy 2005-02-13 11:45:52.772018742 +0100
@@ -50,15 +50,15 @@
return &symbols[symc++];
}
-void Symtable::setType(SymEntry* s, ParseProgram::types type) {
+void Symtable::setType(SymEntry* s, ParseProgram_types type) {
s->valid=1;
s->type=type;
switch(type) {
- case ParseProgram::tINT64: s->value.int64_value=new DynVarInt64(0); break;
- case ParseProgram::tBOOL: s->value.bool_value=new DynVarBool(0); break;
- case ParseProgram::tMAC: { mac_addr a; a.setZero();
s->value.mac_value=new DynVarMac(a); break; }
- case ParseProgram::tIP: { ip_addr a; a.setZero(); s->value.ip_value=new
DynVarIp(a); break; }
+ case tINT64: s->value.int64_value=new DynVarInt64(0); break;
+ case tBOOL: s->value.bool_value=new DynVarBool(0); break;
+ case tMAC: { mac_addr a; a.setZero(); s->value.mac_value=new
DynVarMac(a); break; }
+ case tIP: { ip_addr a; a.setZero(); s->value.ip_value=new DynVarIp(a);
break; }
default: assert(0);
}
}
@@ -634,7 +634,7 @@
| TBLGETMACADR '(' int64expr ')' { $$=new fncTBLgetmacadr(*$3); }
macvar : MACVAR
- | DECLMACA NOTYPEVAR { symtabel.setType($2,ParseProgram::tMAC);
$$=$2->value.mac_value; }
+ | DECLMACA NOTYPEVAR { symtabel.setType($2,tMAC);
$$=$2->value.mac_value; }
ipexpr : ipvar { $$=new VarToExprIp(*$1); }
| ipvar '=' ipexpr { $$=new AssignIp(*$1,*$3); }
@@ -644,7 +644,7 @@
| ipexpr '/' int64expr { $$=new IpMask(*$1, *$3); }
ipvar : IPVAR
- | DECLIPA NOTYPEVAR { symtabel.setType($2,ParseProgram::tIP);
$$=$2->value.ip_value; }
+ | DECLIPA NOTYPEVAR { symtabel.setType($2,tIP);
$$=$2->value.ip_value; }
int64expr: int64var { $$=new VarToExprInt64(*$1); }
| int64var '=' int64expr { $$=new AssignInt64(*$1,*$3); }
@@ -668,7 +668,7 @@
| DECLINT64 '(' boolexpr ')' { $$=new BoolToInt64(*$3); }
int64var : INT64VAR
- | DECLINT64 NOTYPEVAR {
symtabel.setType($2,ParseProgram::tINT64); $$=$2->value.int64_value; }
+ | DECLINT64 NOTYPEVAR { symtabel.setType($2,tINT64);
$$=$2->value.int64_value; }
| NOTYPEVAR { yyerror("Undeclared variabel"); YYERROR;
}
| idexpr '[' int64expr ']' { $$=new fncTBLgetcnt(*$1,*$3); }
@@ -694,7 +694,7 @@
| DECLBOOL '(' int64expr ')' { $$=new Int64ToBool(*$3); }
boolvar : BOOLVAR
- | DECLBOOL NOTYPEVAR {
symtabel.setType($2,ParseProgram::tBOOL); $$=$2->value.bool_value; }
+ | DECLBOOL NOTYPEVAR { symtabel.setType($2,tBOOL);
$$=$2->value.bool_value; }
%%
diff -urN ../tmp-orig/wipl-20020601/src/parseprg.h ./src/parseprg.h
--- ../tmp-orig/wipl-20020601/src/parseprg.h 2000-06-15 16:25:50.000000000
+0200
+++ ./src/parseprg.h 2005-02-13 11:43:59.738858355 +0100
@@ -2,6 +2,9 @@
// section of the configurtion file. Currently only one instance of this class
// may exist.
+// The possible types for symbols:
+typedef enum { tINT32,tINT64,tBOOL,tMAC,tIP,tUNKNOWN } ParseProgram_types;
+
class ParseProgram {
protected:
// The indexing mode we are using:
@@ -11,9 +14,6 @@
static ParseProgram* instance; // Current instance of class or 0
// The user should not modify this variabel
- // The possible types for symbols:
- enum types { tINT32,tINT64,tBOOL,tMAC,tIP,tUNKNOWN };
-
ParseProgram();
~ParseProgram();
@@ -31,7 +31,7 @@
// If INT32 is returned the variabel will be treated as an expression
// (rvalue) and not a variabel (lvalue). That is because integer variabels
// has 64 bits.
- virtual types getSymbol(char* name, void*& location) { return tUNKNOWN; }
+ virtual ParseProgram_types getSymbol(char* name, void*& location) { return
tUNKNOWN; }
// If setProgram returned successfully this can be called as many times
// as wanted to execute the program. Returns an error message on
diff -urN ../tmp-orig/wipl-20020601/src/prgcommon.cc ./src/prgcommon.cc
--- ../tmp-orig/wipl-20020601/src/prgcommon.cc 2002-05-31 19:10:26.000000000
+0200
+++ ./src/prgcommon.cc 2005-02-13 11:44:26.088767194 +0100
@@ -147,7 +147,7 @@
return ca->cards[idx].ipaddr;
}
-ParseProgram::types ScriptExec::getSymbol(char* name, void*& location) {
+ParseProgram_types ScriptExec::getSymbol(char* name, void*& location) {
if(!strcmp(name,"time")) {
location=(int64*)&packettime64;
return tINT64;
diff -urN ../tmp-orig/wipl-20020601/src/prgcommon.h ./src/prgcommon.h
--- ../tmp-orig/wipl-20020601/src/prgcommon.h 2002-05-31 19:08:43.000000000
+0200
+++ ./src/prgcommon.h 2005-02-13 11:44:15.353841328 +0100
@@ -63,7 +63,7 @@
// This is called by setProgram. Can be used by the user to insert own
// variabels:
- virtual types getSymbol(char* name, void*& location);
+ virtual ParseProgram_types getSymbol(char* name, void*& location);
// Consumes a packet returns 0 on succes and error message on fatal error.
// The parameter should be the shared memory area:
diff -urN ../tmp-orig/wipl-20020601/src/wipld.cc ./src/wipld.cc
--- ../tmp-orig/wipl-20020601/src/wipld.cc 2005-02-13 11:46:42.522406209
+0100
+++ ./src/wipld.cc 2005-02-13 11:43:39.196827350 +0100
@@ -39,7 +39,7 @@
card_id_type cit;
// Called on compilation:
- virtual ParseProgram::types getSymbol(char* name, void*& location);
+ virtual ParseProgram_types getSymbol(char* name, void*& location);
// Called on running:
char printbuffer[128]; // Buffer for printing
@@ -73,7 +73,7 @@
ip_port CardCollect::zero_port=0;
-ParseProgram::types CardCollect::getSymbol(char* name, void*& location) {
+ParseProgram_types CardCollect::getSymbol(char* name, void*& location) {
if(!strcmp(name,"srcmac")) { location=&pack.maca_src; return tMAC; }
if(!strcmp(name,"dstmac")) { location=&pack.maca_dst; return tMAC; }
if(!strcmp(name,"srcip")) { location=&pack.ip_src; return tIP; }
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]