__SDCC_LONGLONG is defined in stdint.h for all ports except pic14. And long long library functions are built and regression tested when it is defined. But some such functions only include stdlib.h, so they never get built and tested.
stdlib.h should define __SDCC_LONGLONG for non-pic14. But doing so currently makes thelibrary build run into further issues.
In [r15097], I put the #define in stdlib.h, and disabled the build of strtoull and wcstoull. That way we get at least atoll for now.
Related
Commit: [r15097]
I reckon that the remaining issues (in strtoull and wcstoull) are linked to missing checked integer arithmetic for 64 bit types. See [feature-requests:#749].
Related
Feature Requests: #749
[r15190] adds the same hack to
strtoullandwcstoullthat is used instrtoulandwcstoulfor ports that do not support (unsigned) long long, and re-enables both functions.Checked integer arithmetic for 64 bit types is still missing.
Related
Commit: [r15190]
It seems this "hack" is implemented in
strtoullvery differently fromstrtoul? I see this in my compilation for z80n which uses-Werrorandstrtoulnever caused warning/error, but with this change compilingstrtoull.cgives:Looking at the sources of
strtoulI see:(so it seems warning is never reached) but in
strtoull.cthe equivalent lines are with if 0:That
#if 0forz80ncauses that warning instrtoull.c.I still haven't investigated why it's:
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)instrtoulbut only#if 0instrtoull.cand which of the two is the correct way in the whole context, at this moment I'm just reporting that I see something I haven't seen before.Edit: If I understand correctly: it's different sizes of the variables (and then probably different function names should be there?) and
#if 0has to be there as that code represents a (not fully implemented?) call to functions which don't exist?Edit2: I see now: it's
stdckdint.hwhere other sizes for these functions are, but that ull isn't.Last edit: Janko Stamenović 2025-01-20