Skip to content
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

Discussion: Adding C++14/17 support with -std=c++1z #1134

Closed
tius2000 opened this issue May 24, 2017 · 6 comments
Closed

Discussion: Adding C++14/17 support with -std=c++1z #1134

tius2000 opened this issue May 24, 2017 · 6 comments

Comments

@tius2000
Copy link
Contributor

Would it be a good idea to allow some of the newer language features or are there reasons to stick with C++11? The only issue I found so far is that you need to add a missing function to esp_plusplus.cpp:

//	required when compiling with -std=c++14 or -std=c++1z
void operator delete(void* ptr, size_t n)
{
	if (ptr != NULL)
		free(ptr);
}
@slaff
Copy link
Contributor

slaff commented Jul 13, 2017

allow some of the newer language features or are there reasons to stick with C++11?

@tius2000 It would be great to use C++14/17 features as long as the GCC xtensa compiler supports them. Please, create a new PR and so that we can review it and evaluate it(compiled code size, performance and resource usage(esp. memory), etc.

@jairov4
Copy link

jairov4 commented Jul 31, 2017

I would love it

@mikee47
Copy link
Contributor

mikee47 commented Jun 30, 2019

Current situation seems to be that C++14 and C++1z (17) work on all arches except Linux Esp8266 compiler, so we're stuck with C++11 for now. Haven't tried the Arduino compilers, they're probably more up to date.

@mikee47
Copy link
Contributor

mikee47 commented Aug 29, 2019

Sming install provides Windows MinGW with GCC 6.3, Linux gets GCC 4.8.
It's the < GCC 5 which is preventing moving forwards, 6.3 is good enough for C++17
which I would like to see become the minimum standard.

Some impressive work has been done with the esp quick toolchain.
Current 2.5.0-4 release installs GCC 4.8.2 for all platforms, however source is
available and according to docs. will build for 4.8, 7.2, and 9.1.

I've tried the pre-release for Linux which includes GCC 9.1.0:

https://github.com/earlephilhower/esp-quick-toolchain/releases/tag/3.0.0-gnu1

Sming requires patching to compile, see #1825

@mikee47
Copy link
Contributor

mikee47 commented Nov 30, 2019

The other thing the new toolchains offer is support for C++ exception handling. The Arduino framework offers this as an option, so we can do the same for those as wish to use it.

@slaff
Copy link
Contributor

slaff commented Jan 2, 2020

See #1825.

@slaff slaff closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants