Update old project from 4.2 to 4.12 with tons of C code and GNU compiler update

Hey there,

i have been given a new task for me where i need to update an old project from 4.2 to 4.12. There are tons of Code made in C and a compiler update is mandatory which makes everything very complex. First i got 40k error messages and later i just needed to add some new syntax methods. After no error message i transfered the project but got an instant crash with an error likely a corrupt pointer in c.

Another problem: All global vars are determined in header files and variables in global.var are not accessible in the complier. The project consists largely of C code, some aspects are done in Automation Basic so it is a great task. I am sure this is a massive task…

Has someone made something similar and can give me some advice?
Would you transfer the code to STL? Would you try identify the corrupt pointer? How would you continue?

thanks in advance!

Hi,

I’m not a C expert, and right now I’ve no idea for any advice how to go on except first to check the logger for pagefault backtrace information regarding the crash you mentioned.

I’m replying because I wonder why a GNU compiler update is mandatory when switching from AS4.2 to 4.12?
What I know is, that when porting a project from AS4.12 to AS6.x, a compiler upgrade will be mandatory since AS6 does not longer include those legacy versions of gcc.
But I’m not aware of a mandatory change within the AS 4 family.
I checked AS4.2 and 4.12 compilers, in AS4.12 the older gcc versions 2.95.3 and 4.1.2 are still available (and additionally, AS4.12 also has gcc 6.3.0 available).

Could you please check if the choosen compilers are the same in the AS4.2 project compared to the AS4.12 upgraded project?

Compilers of AS4.2

Compilers of AS4.12

Also, I’m not sure why var declarations and / or header file declaration are not longer recognized? Maybe the’re some interferences because of project settings, could you please check if under “project → settings → general” and “project → settings → ANSI C/C++ compliance” if the following marked settings are the same ones in AS4.2 and AS4.12?
If the’re different, it would lead to some issues about the include and declaration mechanisms.

image

image

Best regards!

1 Like

Is the default include mechanism used in the c-files?
If not this could cause problems with global .var files and libraries.

Is AsString library used in the project?
If so remove this library and use the functions from AsBrStr library.
If this causes compiler errors, solve this errors by using functions from AsBrStr library or in c use the functions from string.h.

AsString could be the cause of not using the default include mechanism.

2 Likes

Hi AI, what is the status of your topic, have you find solution? can you update us and mark reply with solution? thanks Jaroslav