Вопрос

why is it that this compiles:

char * tst1=0;
short * tst2=0;
tst1=tst2;
tst2=tst1;

but this does not:

unsigned char * tst1=0;
unsigned short * tst2=0;
tst1=tst2;
tst2=tst1;

This is just an example to show the compilation error I get. I am porting a project from an older IDE to a newer eclipse based IDE and this used to compile but not on the eclipse IDE.

Basically, there are a bunch of implicit conversions that used to compile but that are now illegal. I would like to know the reasons for this and possible workaround on eclipse to make it a warning again.

Это было полезно?

Решение

The reason would be different parameters passed from eclipse to your C compiler. Try finding them in the previous IDEs configuration or look them up from its output window. If your current IDE is based on Eclipse, you should be able to update the compiler settings without problems (as it is configurable on Eclipse and it would be insane to not let change such a setting...).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top