Opened 15 years ago

Closed 15 years ago

Last modified 2 years 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:



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 by fingolfin, 15 years ago

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

comment:2 by fingolfin, 15 years ago

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 by SF/chrilith, 15 years ago

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 by SF/chrilith, 15 years ago

reorder operators doesn't help much :(

comment:5 by fingolfin, 15 years ago

Owner: set to fingolfin

comment:6 by fingolfin, 15 years ago

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 by SF/chrilith, 15 years ago

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 by fingolfin, 15 years ago

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 by SF/albeu, 15 years ago

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 by fingolfin, 15 years ago

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 by SF/albeu, 15 years ago

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 by fingolfin, 15 years ago

Priority: normalhigh

comment:13 by fingolfin, 15 years ago

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 by sev-, 15 years ago

Priority: highblocker

comment:15 by sev-, 15 years ago

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 by SF/chrilith, 15 years ago

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

comment:17 by SF/chrilith, 15 years ago

workaround is ok for now. Closed.

comment:18 by SF/chrilith, 15 years ago

Status: newclosed

comment:19 by digitall, 2 years ago

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