-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax errors compiling open62541.c with eCos 3.0 #6070
Comments
This project uses C99 since the beginning about 10 years ago. WONTFIX. Your compiler can do both C89 and C99. Or you put the interaction with the standard library in a shallow wrapper. |
I agree that all for loops are a horrible task - but would it be possible to change the two occurrences inside the open62541 header? This would allow compiling open62541.c with -C99 while compiling the remaining code with -C89. |
Sure, if we can make the headers C89 ready with little effort, then we can do so. |
I opened a Pull Request for this (together with 3 other items I modified in my code - I wanted to open separate Pull Requests for them as they are not really related - but my knowledge in Git was not sufficient to accomplish this) |
Description
Compiling open62541 with eCos 3.0 runs into syntax errors:
Background Information / Reproduction Steps
open62541 uses (unnecessarily) extensions to the C programming language which came in with C99. This makes porting into embedded environments with eCos difficult. Especially the following pattern:
for(size_t i=0; ...)
instead of
size_t i; for(i=0;...)
in more than 400 locations makes open62541 hard to use with gcc.
eCos3.0 applications must be compiled with
gcc -std=c89
if they use the standard library thus usinggcc -std=c99
(which would mask the syntax errors in open62541) is not an option.Used CMake options:
cmake -DUA_NAMESPACE_ZERO=FULL -DUA_ARCHITECTURE=eCos -DUA_ENABLE_AMALGAMATION=ON ../
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: