forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DO NOT MERGE] experiment with -d:nimImplicitCompleteStruct showing we need completeStruct
instead of incompleteStruct
#97
Draft
timotheecour
wants to merge
25
commits into
devel
Choose a base branch
from
pr_fix_checkAbi_tmp
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…row (nim-lang#13907) [backport:1.2] * fix nim-lang#13902 distinct uint64 type corruption on 32-bit with borrow Co-authored-by: Timothee Cour <timothee.cour2+lightsail@gmail.com>
Co-authored-by: cooldome <ariabushenko@bk.ru>
Co-authored-by: cooldome <ariabushenko@bk.ru>
* test important packages on Linux * enable chronos
…-lang#13919) [backport] This fixes at least a couple of issues: * Procs loaded from the DLL being used even when the pointer is nil. * The actual issue (nim-lang#13903) which appeared to cause stack corruption on Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the move to loading the procs in `sslSym`.
Co-authored-by: cooldome <ariabushenko@bk.ru>
* posix: add full Haiku support This commit provides a posix_haiku derived from posix_other, with types following Haiku's definition. This fixes cases where the compiler generates type check for the wrong types (ie. checks where generated for an int-derived type but it's actually implemented as an uint instead). * tools/kochdocs: welcome posix_haiku to the blacklist
Also modified tosprocterminate to verify waitForExit implementations.
…izeof5.nim; refactor
…d less verbose than {.importc.})
…o subsequent PRs)
timotheecour
force-pushed
the
pr_fix_checkAbi_tmp
branch
from
April 10, 2020 08:05
ad41811
to
b925433
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I explained in proposal 2 from nim-lang/RFCs#205,
{.incompleteStruct.}
(introduced in 2012) should be deprecated, as it's assuming the wrong default (which is implicit assumption that importc types would be complete unless marked with{.incompleteStruct.}
). Which is why the correct pragma should be{.completeStruct.}
(as introduced in nim-lang#13926) and makes the opposite assumption that importc types are incomplete unless marked with{.completeStruct.}
this experiment-only PR introduces
-d:nimImplicitCompleteStruct
, which when enabled, allows CT sizeof; it then compares withc_sizeof
. It shows that most importc types are in fact incomplete, and the CT sizeof differs from c_sizeof.Only very few types are annotated with
{.incompleteStruct.}
so most code out there would be wrong if that flag had any meaning.It would be pointless to have to annotate all those types with
{.incompleteStruct.}
, when in fact the sane thing to do is to opt-in CT sizeof instead of opt-out.nim c -r --stacktrace:off -d:nimImplicitCompleteStruct -f $timn_D/src/timn/exp/abichecks.nim
prints: