-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Format request]: C++ array #63
Comments
This came about because, while GCC will do what it always does, |
Edit: which was solved by including the generated |
Hi @jaskij, you certainly aren't alone in writing firmware in C++. I've been involved in doing just that on-and-off for the past 20+ years. This is a great idea! Regarding C++ standards, I'd be keen to keep it to features from C++14 or earlier. This will give the best chance of aligning with a validated compiler for heavily regulated industries such as medical device development and safety systems. Implementing the actual format itself will be pretty straight forward (I've already done the boilerplate :-) ) As for the question around inline vs static vs [other option], I've reached out to a couple of friends and will give it some thought. Others who contribute to SRecord may also want to offer advice. Meanwhile, regarding:
|
From my knowledge, the only interesting point is
No, the C header doesn't work, because I work in a small company, with a lot of freedom, so I luckily have the option to use basically whatever ARM's latest release of GNU Toolchain supports (C++20, at the moment). |
I got reminded of this issue recently, and just today learned about C23's |
Call me crazy, but I program microcontrollers in C++.
To that end, while the C array is perfectly adequate, over the years the languages are diverging more and more. I propose adding a new output format, the C++ array.
The question is of specific output format, how it should be done.
My idea is to:
To that end, I believe the outline below to be appropriate. Although I would love for someone with a better grasp of the C++ standard to check if what I'm doing here with
inline
vsstatic
is the right way.More on the
inline
keyword: cppreference.com notes:If my understanding is correct,
inline
will result in more of a guarantee that the array will not be duplicated in the resulting program/library.The text was updated successfully, but these errors were encountered: