Problem with implicit type conversion...


I'm trying to compile the xerces library with Dev-C++ over MinGW, and I'm getting conversion errors from all of the conversions to wchar of XML strings... If I put the explicit cast [for example: (wchar_t *)]
Everything works, anyway I don't want to write all the casts while the code compiles properly over cygwin...

Is there any option to for the compiler to cast automatically all this things?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you post the exact errors and the sample code?  It might be that the compiler has a hard time picking between two conversions that it considers equally good - different compilers may have different behavior in this regard.  It's unlikely there will be a flag to alliviate your problem - but you might be able to change one of the classes in such a way that the conversion issues don't arise.
abusimbelAuthor Commented:
Hello travd,

To post the sample code is not the point because is 20MB, but enough saying that is a code that compiles fine with MS VC6, and with the same compiler in different platform. But when I'm trying I'm getting the error "Invalid conversion from (type #1) to (type #2)", I don't know why happens, and maybe there is an option to avoid it... Like the -pedantic to for the ansi special...

Thanks again,
Well what I'm saying is that gcc (which I assume you're using) is less tolerant of conversion problems than some other compilers.  We build for five platforms, with five different compilers, and when gcc is the only one to complain about some code, it's often a conversion problem.  I doubt there is a flag you can use to fix this - flags usually make the compilation warning/error process stricter, not more lenient.

You don't need to post 20 MB of code - but instread a single line that causes the erorrs, along with the definitions of the types in that line, and also the exact error message reported by the compiler for that message.

You can also try the option --disable-c-mbchar to gcc (or --enable-c-mbchar, but that should be the default).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: travd {http:#9930342}

Please leave any comments here within the next four days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.