Hello,
is there a way to have the code organized like this, such that the s32 doesn't generate errors? The error reported will be
Symbol 'INCREMENT_STEP' could not be resolved.
<<<main.c>>>
#ifndef MAIN_C_
#define MAIN_C_
#include "main.h"
int main(void) {
uint8_t counter;
while(1) {
counter += INCREMENT_STEP;
}
}
#endif // #ifndef MAIN_C_
<<<main.h>>>
#ifndef MAIN_H_
#define MAIN_H_
//global constant
#define GLOBAL 10
#ifdef MAIN_C_
//private constants
#define INCREMENT_STEP 2
#endif // #ifdef MAIN_C_
#endif // #ifndef MAIN_H_
This is a legit code which will get built successfully, but the s32 will report an error since its "live compiler" isn't aware that the MAIN_C_ will be defined when main.c includes main.h. I don't want to suppress all errors, and I don't like suppressing all "symbol could not be resolved" errors. I know I can use #pragma for inline error suppression, but that would make the code messy. Any alternatives?
Solved! Go to Solution.
Hi,
which version of S32DS you use? for power or for ARM? I have tested the use case in S32DS for power version 1.1 with update 1 and it seems this error does not appear.
But there was a problem with parsing in previous version of S32DS.
Please write me back the version and in case you do not use the newest one, please install it.
Regards,
Martin
I haven't installed the latest update, I will now. Thank you for the prompt response.
Hi,
which version of S32DS you use? for power or for ARM? I have tested the use case in S32DS for power version 1.1 with update 1 and it seems this error does not appear.
But there was a problem with parsing in previous version of S32DS.
Please write me back the version and in case you do not use the newest one, please install it.
Regards,
Martin
Oh sorry, the S32 version was S32 Design Studio for Power Architecture v1.1 without update. Now it is updated and working.
Thank you Martin,
Updating the S32DS seems to have fixed the problem.
Kind regards,
Hrvoje