-
Notifications
You must be signed in to change notification settings - Fork 177
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
[Error] ws_pae_time.c@174,103: expected ')' before 'PRIi64' #997
Comments
Hi |
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 |
After I ran "sudo pip install -U -r requirements.txt" in directory "mbed-os", it was prompted a python module "future" was missing, before I ran "sudo pip install -U -r requirements.txt", it was prompted 3 python modules "future, requests, click" were missing. Then I ran "pip install future" under "mbed-os", it was said "future" has been installed, but there was still error:ws_pae_time.c@174,103: expected ')' before 'PRIi64'. |
I found the function where "Error" was prompted: `int8_t ws_pae_current_time_set(uint64_t time)
} Should "expected ')' before 'PRIi64'" ? |
If you use Our tests compile OK with Gcc Arm for multiple boards: you can check the latest nightly http://mbed-os-ci-public.s3-website-eu-west-1.amazonaws.com/?prefix=jenkins-ci/ARMmbed/mbed-os/mbed-os-ci-nightly/artifacts/master/943/build-example-GCC_ARM/PASS/ |
I think this is related to https://en.cppreference.com/w/cpp/types/integer especially see the:
Simple fix would be to change:
to
But I recall that this does not occur with GCC10 anymore, I have seen few similar reports with GCC9 compiler. (I just was not able to reproduce the issue myself). |
Thanks @teetak01 The nightly I shared are using v10, however previously we run Gcc 9 (updated back in August so the code its failing was already present on master). Can you test the proposed fix? And send a pull request if it's tested ? |
The thing is, there are few dozen entries like this in Mbed OS (nanostack) code (which is C), and it has been there for years. I wonder if something else has changed in between that triggered this kind of check/error. Yet, that has never reproduced in CI with any compiler. Of course most/all of those seem to be in trace-lines, so non-trace enabled builds probably will not be impacted. |
The C++ space thing is specifically C++11 or later, and we did have to clear that up from a bunch of C++ files when we moved to C++14 in Mbed OS. Doesn't affect C99 files like this. And you'd get a different error message about an unknown user-defined literal. This error seems to correspond to Do try adding the space, but if that fixes it, I think that would be a compiler bug. I can't offer a better explanation at the minute. Check that your mbed_trace.h is including |
I tried to compile the Blinky example by Mbed CLI, while it was prompted:
https://ibb.co/FhtfkFr
I have already used "sudo pip install -r requirements.txt":
https://ibb.co/NnJfF1T
https://ibb.co/1G8LPFW
The text was updated successfully, but these errors were encountered: