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
Fix #3276: Remove two major defects in posixlib utsname.scala #3280
Fix #3276: Remove two major defects in posixlib utsname.scala #3280
Conversation
The one failure is in Windows initialization code and has nothing to do with the All else is Green, like Kermit. |
@mox692 Is it consistent with what you set out to do? |
I was wondering if we have to model the struct as a set of |
@LeeTibbert |
Eric, thank you for the discussion. It is always worthwhile to ask if one is inside I think that leaving the CArray declarations as is is the the better way to go. Staying I put a note in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @LeeTibbert.
I left just one question, but other part looks ok to me.
|
||
#define SIZEOF_FIELD(t, f) (sizeof(((t *)0)->f)) | ||
|
||
_Static_assert(SIZEOF_FIELD(struct scalanative_utsname, sysname) <= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, shouldn't we write
SIZEOF_FIELD(struct utsname, sysname)
instead of
SIZEOF_FIELD(struct scalanative_utsname, sysname)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mox692 You are absolutely correct. Good catch, thank you.
Fixed now.
Fix #3276.
I theory, this PR, is not a candidate for backport. However, the code in SN 0.4.n is
so broken that a backport could not be accused of being a breaking change.
Two major defects in
utsname
are removed:the
uname
method can not longer write to Scala Native memory that itdoes not "own".
fields in the
utsname
structure after the first, saynodename
orversion
nowcontain valid data as returned by the OS. Previously they had most likely been
empty strings.
An entry was made in the 0.5.0 changelog which should cover this PR and the prior
PR #3264 by mox692.
My personal thanks to mox692 for shining the light on
utsname
and causingdetailed review.