Degraded C++ error messages.
Gabriel Dos Reis
gdr@integrable-solutions.net
Fri Nov 7 16:40:00 GMT 2003
Carlo Wood <carlo@alinoe.com> writes:
| Hiya,
|
| this is going to be a thread to which I will add unreadable
| or very much degraded error message of g++. Being mainly
| a *user* of g++, it is my experience that the error messages
| have gotten less and less practical value.
|
| Example 1.
|
| 5: std::vector<int> v;
| 6: int* p = v.begin()->base();
|
| ~>g++-2.95.3 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: request for member `base' in `*v.vector<int,allocator<int> >::begin()', which is of non-aggregate type `int'
|
| ~>g++-3.3.2 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: error: request for member `base' in `*(&std::vector<_Tp,
| _Alloc>::begin() [with _Tp = int, _Alloc =
| std::allocator<int>]())->__gnu_cxx::__normal_iterator<_Iterator,
| _Container>::operator->() const [with _Iterator = int*, _Container =
| std::vector<int, std::allocator<int> >]()', which is of non-aggregate type `
| int'
|
| ~>g++-cvs-3.4 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: error: expected type-name
| troep.cc:6: error: expected `::'
| troep.cc:6: error: expected `~'
| troep.cc:6: error: expected identifier
I much prefer the error message that displays expressions (althougth it
could be improved), but some people seems to like the "typed" ones --
it should be recalled that C++ expressions can not be consistently and
accurately captured by types only. I find it quite unreadable.
Clearly, the "expected" thingy is Morse to me.
(Interestingly, this kind of incomprehensible messages has been
pointed out by Benjamin last week; there were quite hilarous variations
on them).
-- Gaby
More information about the Gcc
mailing list