Comments (9)
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 PRIi64
being undefined, which it shouldn't be, because mbed_trace.h (at least the versions I'm looking at) includes <inttypes.h>
which should provide it.
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 <inttypes.h>
.
from mbed-cli.
I think this is related to https://en.cppreference.com/w/cpp/types/integer especially see the:
Because C++ interprets a character immediately following a string literal as a user-defined string literal, C code such as printf("%"PRId64"\n",n); is invalid C++ and requires a space before PRId64.
Simple fix would be to change:
tr_debug("Current time set: %"PRIi64, time);
to
tr_debug("Current time set: %" PRIi64, time);
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).
from mbed-cli.
Hi
I think your GCC version is too old ?
from mbed-cli.
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
from mbed-cli.
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'.
from mbed-cli.
I found the function where "Error" was prompted:
`int8_t ws_pae_current_time_set(uint64_t time)
{
uint64_t new_system_time;
current_time = time;
tr_debug("Current time set: %"PRIi64, time);
if (ns_time_system_time_read(&new_system_time) == 0) {
// System time has gone backwards
if (new_system_time < current_time || new_system_time > current_time + SYSTEM_TIME_MAXIMUM_DIFF) {
tr_error("FATAL: system time less than reference time or more than 12 months in future: %"PRIi64" reference time: %"PRIi64, new_system_time, current_time);
return -1;
}
}
return 0;
}
`
Should "expected ')' before 'PRIi64'" ?
from mbed-cli.
If you use --verbose
you should be able to get a command and just run it to compile the file. I don't think this is related to mbed tools but rather gcc.
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/
from mbed-cli.
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 ?
from mbed-cli.
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.
from mbed-cli.
Related Issues (20)
- mbed deploy cannot handle changing URI for .lib-files
- Long time without activity: [mbed] Downloading library build "3a7713b1edbc" (might take a while)
- initialize or export selected target only? HOT 3
- Copying hex instead of bin HOT 12
- New BLUEPILL_F103C8 target problem HOT 1
- The single biggest issue HOT 2
- mbed export -i vscode_gcc_arm problem HOT 1
- Experiencing problems in installing mbed-CLI manually on Windows 10 HOT 1
- Issue with version when creating a new program HOT 8
- Problem during compilation HOT 1
- Unable to install mbed on Debain 10 HOT 1
- 'list index out of range' when calling 'mbed device-management' with no further argument
- Improve generated Makefile from `mbed export -i make_gcc_arm`
- Error compiling simple blinky against NUCLEO_G031K8 target HOT 2
- mbed compile --flash does not respect 'artifact_name' HOT 1
- Only rewrite config when there are changes
- multiple calls of mbed update fail for branches containing a "/" character HOT 1
- Wrong RAM/flash usage reported by Mbed CLI
- Mbed detect does not work on my terminal even though I have connected my NUCLEO_F103RB. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbed-cli.