#28 verilog-20060215 does not compile with gcc version 4.1.0 pre

devel
closed-fixed
nobody
5
2006-03-25
2006-03-25
No

Hi,

I tried to compile the Icarus snap shot
verilog-20060215 with the prerelease gcc version
4.1.0 20060123 under Suse Linux and get the following
compiler error:

make
g++ -DHAVE_CVS_IDENT=1 -DHAVE_CONFIG_H -I. -I. -Wall
-g -O2 -MD -c main.cc -o main.o
PExpr.h:383: error: extra qualification ‘PEString::’
on member ‘eval_const’
make: *** [main.o] Error 1

Looking into PExpr.h:

[...]

365: class PEString : public PExpr {

[...]

383: verinum* PEString::eval_const(const
Design*, NetScope*) const;

[...]

I googled for that error message and found this post
for the same error message from another project:

> This is a C++ problem of older C++ code.

> usually you have

> class Foo {
> ...

> Foo::blub();
> ...
> };

> This extra Foo:: has to go.

It has been a while since I programmed C++ so I am
not so familiar what change happened here.

Did gcc got more picky?

Cheers,

Guenter

Discussion

  • Patch for PExpr.h

     
    Attachments
  • Logged In: YES
    user_id=1000725

    Alright, that was the only place causing a problem.

    After I took out the PExpr:: in line 383 of file PExpr.h
    the code compiled fine with gcc 4.1.

    I attached a diff between verilog-20060215 and the
    modification I did.

    I have never done a patch file before, if it does not work,
    let me know.

    Cheers,

    Guenter

     
  • Logged In: YES
    user_id=97566

    The patch seems perfectly fine, and I've checked it into CVS.
    Thanks very much for taking the time to report this.

    And yes, newer gcc versions are increasingly more picky.

     
    • labels: 776903 --> Portability (won't compile on O/S brand-X)
    • status: open --> closed-fixed