g++ compiler complains about conversions between related types (from int to enum, from void* to class*, from const char* to unsigned char*, etc.). Compiler handles such convertions as errors and won't compile furthermore. It occurs only when I compile using Dev-C++ IDE, but when I compile the same code (using the compiler which Dev-C++ uses) such errors (even warnings) do not appears. How to mute errors of such types?
views:
78answers:
2
+2
A:
I suspect that in one case you are compiling your code as C and the other as C++. In C++, there is no implicit conversion from void * to any other type of pointer, and a C++ compiler which did not diagnose this as an error would be broken. You need to supply more details of how you are compiling your code.
Also, DevC++ is a pretty awful piece of code. It's buggy and no longer being actively developed, as well as being butt-ugly. You should seriously consider switching to a more modern and capable IDE, such as Code::Blocks.
anon
2010-04-21 16:53:32
Yes, that's right - problem was in g++ compiler - I compiled the same code using gcc compiler and it worked fine. Thanks!
Slav
2010-04-21 18:07:59
@Slav, please, be more correct: the problem was not in the compiler, but in *your incorrect choice* of compiler.
Pavel Shved
2010-04-21 18:12:51
@Pavel If we are going to start correcting English usage in comments, it's going to be a long night.
anon
2010-04-21 18:14:49
@Neil, I don't like when people blame tools for their own faults, that's all. (But if it is just incorrect use of English, I'm taking back what I said.)
Pavel Shved
2010-04-21 18:18:17
Of course! I was must to write "problem was in CHOOSING g++ compiler" - sorry for that.
Slav
2010-04-21 18:26:11
I think it's need to keep questions and answers up to language rules and especially programming semantic - it will be helpful in learning both language and programming.
Slav
2010-04-21 18:32:42
@Slav, good point. By the way, StackOverflow has a notification system (see how that envelope at the top turns yellow?), here's some tips on how to use it: http://meta.stackoverflow.com/questions/43019/how-do-comment-replies-work
Pavel Shved
2010-04-21 18:50:56
A:
All of your implicit conversions are disallowed in standards conforming C++. G++ is simply enforcing these rules.
Yann Ramin
2010-04-21 17:25:14