-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fix for undefined reference to atexit() function. #2229
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
Conversation
Added replacement stub for cstdlib `atexit()` funciton.
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function `atexit` can be redefined in user code.
Code looks good to me. I do have some comments on the PR itself:
To update your pullrequest, you can apply the changes locally (if you don't know how, try running I think having a PR for |
I regularly merge @Chris--A |
I have tried downloading the repo on windows a couple of times without luck, I have made this request via the webpage which is why its two commits. I'll try again to see if it will work. If it does, I'll update the PR. It mat take a few hours so I'll report back. I will also update the pull request info too. |
Every time I try and clone the repo it fails. Git-hub responds that the repo is in an unknown state and possibly corrupted. I think windows git-hub has some problems with long path names. I can update the code comments, however it requires an additional commit when using the web page editor. |
If you update using the editor, then either @cmaglie can manually merge and squahs the commits, or perhaps I can do it and create a new PR for it. |
I've manually merged the patch, here the "squashed" commit: Thank you! |
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919 (Filtered from arduino/Arduino@1bbcb2f)
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
This is an empty stub to simply allow use of complex types with a non global static lifetime. For more complex handling the function 'atexit' can be redefined in user code. For more information see: arduino/Arduino#2229 arduino/Arduino#1919
Hi, I recently ran into an issue which is present in all branches of the IDE.
The linker fails due to a missing standard library function
atexit()
.This issue affects all IDE branches I have tested:
The problem manifests itself when giving an object with a defined destructor, static local storage duration.
Here are two basic examples of the error:
Its not the String libraries fault, any object that requires implicit destruction causes an error:
The fix I propose will allow these examples to compile, and I have tested it on the three versions of the IDE I mentioned above.
I created this patch on the master, can you automatically merge this with 1.5.x, or do I need to make a new pull request?
As a side note, if the function is moved else where, it must be declared
extern "C"
. This is taken care of by Arduino.hFixes #1919