Skip to content
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 jl_static_show for bitstype #17803

Merged
merged 1 commit into from
Aug 4, 2016
Merged

Fix jl_static_show for bitstype #17803

merged 1 commit into from
Aug 4, 2016

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented Aug 4, 2016

The byte gets sign extended when passing to the vararg jl_printf and then printed as an unsigned int which might come with unwanted ffffff prefix.

This happens on my machine where PRIx8 is x which is the right format but doesn't truncate the input.... (If not for Windows support we could just use hhx formatting string).....

The byte gets sign extended when passing to the vararg `jl_printf` and then
printed as an unsigned int which might come with unwanted `0xff` prefix...
@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

lgtm

@yuyichao yuyichao merged commit 76fedd3 into master Aug 4, 2016
@yuyichao yuyichao deleted the yyc/jl_-bitstype branch August 4, 2016 08:01
@tkelman
Copy link
Contributor

tkelman commented Aug 4, 2016

can this be tested?

backport or not?

@yuyichao
Copy link
Contributor Author

yuyichao commented Aug 4, 2016

can this be tested?

Pretty hard for normal test. Possibly doctest.

backport or not?

Ideally should be on both 0.5 and 0.4.7

@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

we should be able to write tests without too much difficulty:

julia> p=Pipe()
Pipe(null => null, 0 bytes waiting)

julia> Base.link_pipe(p; julia_only_read=true, julia_only_write=true)

julia> ccall(:jl_static_show, Void, (Ptr{Void}, Any), p.in, "world")

julia> @async close(p.in)

julia> readstring(p.out)
"\"world\""

@tkelman tkelman added the needs tests Unit tests are required for this change label Aug 11, 2016
tkelman pushed a commit that referenced this pull request Aug 11, 2016
The byte gets sign extended when passing to the vararg `jl_printf` and then
printed as an unsigned int which might come with unwanted `0xff` prefix...

(cherry picked from commit bffa84e)
ref #17803
ranjanan added a commit to ranjanan/julia that referenced this pull request Aug 11, 2016
The PR fixes jl_static_show for bitstypes
yuyichao added a commit that referenced this pull request Aug 21, 2016
tkelman pushed a commit that referenced this pull request Aug 21, 2016
The PR fixes jl_static_show for bitstypes

(cherry picked from commit 718391d)
ref #17961

Change test to Int128(-1)

(cherry picked from commit 462a1eb)
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
The PR fixes jl_static_show for bitstypes
tkelman pushed a commit that referenced this pull request Sep 13, 2016
The byte gets sign extended when passing to the vararg `jl_printf` and then
printed as an unsigned int which might come with unwanted `0xff` prefix...

(cherry picked from commit bffa84e)
ref #17803
tkelman pushed a commit that referenced this pull request Sep 13, 2016
The PR fixes jl_static_show for bitstypes

(cherry picked from commit 718391d)
ref #17961

Change test to Int128(-1)

(cherry picked from commit 462a1eb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants