programming language that does not inhibit further optimization by gcc

David Brown david.brown@hesbynett.no
Sat Mar 30 10:42:00 GMT 2019


On 30/03/2019 08:13, Albert Abramson wrote:
> Now I'm on a totally unrelated project, writing code in C, but still using
> the GCC compiler under the hood.  The previous developers used raw pointers
> quite a bit.  However, as I expand the code, I'd like to use some of the
> features in C++, but Atmel Studio doesn't REALLY support C++.
>   Code::Blocks is letting me turn warning flags on and off, but I don't see
> the same for individual C++ features.  (Lots of subsets of C++, but I
> really need a true superset of C.)
> 
> Is there some way to manually turn on individual C++17 features, one at a
> time?  I read somewhere that you can, but I don't see the post online
> anywhere.  And if I create a list of individual C++ features, can this made
> into a kind of standard, shared with other programmers?  In other words,
> I'd like to make use of lambdas, namespaces, smart pointers, range-based
> for loops, and a few others that would save me a lot of time and maybe even
> reduce the size of the binary (since we're very RAM limited in the embedded
> world).
> 
> I'm writing about this on the Facebook page "C+ Project," which is open to
> all programmers.
> 

Your post here is new - it is not helpful to make it a follow-up on a 6 
year old conversation.  And it is not helpful to write as though we are 
all familiar with what you are doing and the projects you work on.

To get the crux of the matter, it seems that you want to write mainly C, 
but use some C++17 features.  The way to do that is with C++17.  You 
don't "turn on individual C++17 features" - you enable C++17 support 
(with the "-std=gnu++17" flag support) and just use the features you 
want (limited by the lack of C++ libraries for the AVR).


If you choose to use an IDE and use it to control compiler flags, there 
is always a way to manually enter flags yourself.



More information about the Gcc mailing list