Hi all
I have some really old code for a PIC16 microprocessor, compiler not 100% known but it might be ccs, that in a couple of parts does the following:
I know this isn't legal C but bear in mind that the source code initially was case insensitive so...Code:int16 p_16; int8 eeadr=73; //70..73 int8 i; p_16=&variable; // variable is of type int32 for (i=1;i<=4;++i) { *p_16=read_eeprom (eeadr); p_16++; eeadr--; }
My question is, does anybody see any potential that this can cause issues with an ever growing stack etc. Or any other issues (apart from not correct C)? int16 is NOT typedefed/defined to a pointer type, it is used as a value type in other parts of the same source file.
The microcontroller is reset every now and then, because of (what we hear) stability issues, and we are trying to find out what can cause that, and this snippet of code stood out.
Anybody has any tips/leads/something/anything?
Are there any known compilers where a p_ prefix to variables will cause the variable to actually be a pointer (thus the code is a non-issue)?