-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[WIP] fix {.incompleteStruct.} (implied wrong typeinfo) #14228
Closed
timotheecour
wants to merge
9
commits into
nim-lang:devel
from
timotheecour:pr_remove_incompleteStruct
Closed
[WIP] fix {.incompleteStruct.} (implied wrong typeinfo) #14228
timotheecour
wants to merge
9
commits into
nim-lang:devel
from
timotheecour:pr_remove_incompleteStruct
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
timotheecour
force-pushed
the
pr_remove_incompleteStruct
branch
from
May 4, 2020 23:23
e9f095e
to
6933f7e
Compare
timotheecour
changed the title
{.incompleteStruct.} is now a deprecated noop; was wrong default + implied wrong typeinfo
[WIP] {.incompleteStruct.} is now a deprecated noop; was wrong default + implied wrong typeinfo
May 5, 2020
timotheecour
force-pushed
the
pr_remove_incompleteStruct
branch
from
May 5, 2020 09:00
965172b
to
3db7539
Compare
Clyybber
reviewed
May 5, 2020
Clyybber
reviewed
May 5, 2020
timotheecour
force-pushed
the
pr_remove_incompleteStruct
branch
from
May 5, 2020 10:53
53d7fad
to
32bacd0
Compare
timotheecour
force-pushed
the
pr_remove_incompleteStruct
branch
from
May 5, 2020 10:55
32bacd0
to
46ed26e
Compare
timotheecour
changed the title
[WIP] {.incompleteStruct.} is now a deprecated noop; was wrong default + implied wrong typeinfo
[WIP] fix {.incompleteStruct.} (implied wrong typeinfo)
Jul 4, 2020
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.
EDIT: DO NOT REVIEW YET...
the meaning of
{.incompleteStruct.}
is for types like DIR (eg http://manpages.ubuntu.com/manpages/bionic/man7/dirent.h.7posix.html) which are forward declared, and hence for which sizeof (or accessing members or creating an instance on the stack etc) would result in cgen CT error on some platforms. Treating it like we used to (viavoid*
) is clearly wrong though. Investigating how to best handle this... stay tuned.THE DESCRIPTION BELOW NEEDS TO BE UPDATED
$
, {.sizeof.}, const CVAR {.importc.}: int RFCs#205 by turning {.incompleteStruct.} into a deprecated noopincompleteStruct (only used on 2 types, DIR and FILE) is problematic because when that pragma was set but the type was in fact not forward decared, it resulted in incorrect typeinfo
note that FILE is a struct in C, not a struct pointer, so treating it as
void*
was incorrect as can be seen with this:links
When to use IncompleteStruct pragma? - Nim forum