Opened 14 years ago

Closed 14 years ago

Last modified 6 months ago

#2056 closed defect

ALL: list.h doesn't compile with CodeWarrior

Reported by: SF/chrilith Owned by: fingolfin
Priority: blocker Component: Port: PalmOS
Keywords: Cc:
Game:

Description

Hi,

CodeWarriror for PalmOS failed to compile the list.h
code with the error :

Error : illegal use of 'explicit'
(included from:
config-file.h:26
config-file.cpp:24)
list.h line 57 explicit Iterator<T2>(NodeBase *node) :
_node(node) {}

and so scummvm don't compile anymore. If someone
can help :)

Thanks
Chris

Ticket imported from: #1212512. Ticket imported from: bugs/2056.

Change History (19)

comment:1 Changed 14 years ago by fingolfin

Summary: list.h doesn't compile with CodeWarriorALL: list.h doesn't compile with CodeWarrior

comment:2 Changed 14 years ago by fingolfin

Appears to be a bug in CodeWarrior. Annoying. <sigh>

I asked you before, but for the sake of referencing it on this bug tracker
item, please state what happens if you simply remove the "explicit"
keyword.

comment:3 Changed 14 years ago by SF/chrilith

if i remove 'explicit' :

Error : illegal initialization
(point of instantiation: 'Common::ConfigFile::ConfigFile()')

(instantiating: 'Common::List<Common::ConfigFile::Section>::
~List()')

(instantiating: 'Common::List<Common::ConfigFile::Section>::
clear()')

(instantiating: 'Common::List<Common::ConfigFile::Section>::
erase
(Common::List<Common::ConfigFile::Section>::Iterator<Com
mon::ConfigFile::Section>,
Common::List<Common::ConfigFile::Section>::Iterator<Com
mon::ConfigFile::Section>)')

(instantiating: 'Common::List<Common::ConfigFile::Section>::
Iterator<Common::ConfigFile::Section>::operator++(int)')
list.h line 69 Iterator<T2> tmp(*this);

comment:4 Changed 14 years ago by SF/chrilith

reorder operators doesn't help much :(

comment:5 Changed 14 years ago by fingolfin

Owner: set to fingolfin

comment:6 Changed 14 years ago by fingolfin

Actually the ++/-- postfix operators were wrong! I am not
sure how exactly they worked, but due to luck/chance, it
seems GCC manages to find the correct type conversion path.
Anyway, I fixed this in CVS, the postfix operators now
should do the right thing.

I still have no idea about the "explicit" keyword error, but
the error you got after removing it shold be gone now, so
please try again with latest CVS and explicit removed ...

comment:7 Changed 14 years ago by SF/chrilith

Well, no change :(

I thing i'll remove the use of ++ operator and replace

iterator erase(iterator first, iterator last) {
while (first != last)
erase(first++);
return last;
return 0;
}

with something else

comment:8 Changed 14 years ago by fingolfin

That would just avoid the problem though; the next time
somebody uses the postfix operator, you'll be in troubles
again.

Anyway, you mean you get the exact same error? That's quite
strange, given that the code now does something different.
Hm.

comment:9 Changed 14 years ago by SF/albeu

On a side note gcc 2.95.3 refuse to compile that file too:

common/list.h: In method `T2 &
Common::List<T>::Iterator<T2>::operator *() const':
common/list.h:89: `Node' is not a template
common/list.h:89: ANSI C++ forbids declaration `' with no type

comment:10 Changed 14 years ago by fingolfin

albeu, that's simply yet another bug in GCC 2.95.3; we
aren't really supporting GCC 2.x, which never fully
implemented C++...

chrilith, you didn't really reply to my last comment...
anything useful to add?

comment:11 Changed 14 years ago by SF/albeu

0.7.0 compile just fine with 2.95.3 Anyway if it's not
supported anymore then the configure should probably reject
it. Currently it even still contain:

echo "Please ensure you are using GCC 2.95.x or GCC 3.x"

PS: Sorry i know this doesn't really belong to this issue.
But as the same change broke several compiler that used to
work, i tought it might be worth noting it.

comment:12 Changed 14 years ago by fingolfin

Priority: normalhigh

comment:13 Changed 14 years ago by fingolfin

albeu, this indeed doesn't belong here. Please file a seperate report if
you want (be warned, it'll receive a low priority). Those aren't the
same issues either, if you compare the line numbers (just two different
C++ compilers who have different bugs related to template code choking
by chance on the same file).

comment:14 Changed 14 years ago by sev-

Priority: highblocker

comment:15 Changed 14 years ago by sev-

If it still appears in Codewarrior. Then it is critical.
Though, Chrilith, I had an impression that you compiled
ScummVM recently without a problem.

What is the status of this item?

Raising priority

comment:16 Changed 14 years ago by SF/chrilith

i have changed list.h so that it compiles, but it's not a fix.
Anyway this can be closed.

comment:17 Changed 14 years ago by SF/chrilith

workaround is ok for now. Closed.

comment:18 Changed 14 years ago by SF/chrilith

Status: newclosed

comment:19 Changed 6 months ago by digitall

Component: --Unset--Port: PalmOS
Note: See TracTickets for help on using tickets.