The definition of _aligned_alloc inline function in stdlib.h causes errors in 3.8.0 .
The error seen is
code2.asm:139:Error[113] Symbol not previously defined: "_aligned_alloc"
Error[181] System error while writing object file.
with command: sdcc-sdcc --use-non-free -mpic14 -p16f88 -c code2.c
Where code2.c is simply the following 2 lines:
#include <pic16f88.h>
#include <stdlib.h>
I suspect this is caused by the same underlying issue as bug [#2855].
Philipp
Related
Bugs:
#2855Last edit: Maarten Brock 2019-11-02
Since bug #2855 is fixed, you might want to check, if this one is fixed, too.
Since no further infromation was provided, I'll assume that this issue got fixed long ago.
Hi Philipp.
I don't think this problem is fixed, I am using SDCC 3.9.0 and the MPLABx SDCC Plugin running on windows 10.
When I compile this simple code:
I get this compiler error:
I have installed SDCC on my D drive instead of my C drive because there is more space, I have also checked all the environment paths and I can get the code to compile if I leave out
<stdlib.h>Do you have any suggestions?
Thanks for your time.
Last edit: Malcolm Swart 2019-06-11
It seems beside the now fixed aligned_alloc-specific bug [#2855] that affected multiple backends, there is another, pic14-specific problem affecting all inline functions.
There currently is work on improving hte pic14 backend; it seems the issue will be fixed with that. It might take a bit of time, but I think the fix will be in trunk in a few weeks, and thus also in the next SDCC release.
For details see the discussion on patch [patches:#303].
Philipp
Related
Bugs:
#2855Patches: #303
Last edit: Maarten Brock 2019-11-02
Thanks for your feedback.
I can confirm that for pic16 this not a problem, compiling the code was successful...
Just abit off topic though, when compliling the same code for pic18f458 MPLAB says my symbol usage is already at 31% for the memory (used: 480b --> free:1056b).
This seems odd to me as my code is not declaring any variables:
Is there an explanation for this somewhere, in documentation or forum?
Is there an alternative way of checking if MPLAB is correct?
Thanks for your time.
Unfortunately, I'm not familiar with the pic. For most SDCCbackends, the linker generates a .map file that contains information on memory usage. I guess the linker from gputils can create a similar file.
Ok looking at the .map file I see that most of the symbols defined is related to the special purpose registers, I guess the makes sense as a portion of the memory is defined as SPRs and then the rest is general purpose, another thing that is added is a stack, loop variables and a lookup address fo what ever reason.
Thanks for your insight.
Regards.
Diff: