ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
brakmic has quit []
mnoronha has joined #zig
rom1504 has quit [Ping timeout: 252 seconds]
mnoronha has quit [Ping timeout: 255 seconds]
rom1504 has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 245 seconds]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
mnoronha has joined #zig
tobbez has quit [Ping timeout: 250 seconds]
tobbez has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
tobbez has quit [Ping timeout: 258 seconds]
tobbez has joined #zig
mnoronha has joined #zig
tobbez has quit [Ping timeout: 258 seconds]
tobbez has joined #zig
tobbez has quit [Ping timeout: 240 seconds]
tobbez has joined #zig
tobbez has quit [Ping timeout: 258 seconds]
tobbez has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
tobbez has quit [Ping timeout: 252 seconds]
tobbez has joined #zig
tobbez has quit [Ping timeout: 252 seconds]
whatupdave has joined #zig
tobbez has joined #zig
<whatupdave> can zig import c++ header files?
tobbez has quit [Ping timeout: 240 seconds]
suirad has joined #zig
tobbez has joined #zig
<suirad> can anyone explain why I am getting the correct asm that I expect, but when i use it, I end up segfaulting? https://godbolt.org/z/-2LAKL | To be clear, I am experimenting with: * making trampoline functions; * having the trampoline hot swappable(preferrably without disabling DEP); * having the type system enforce proper swapping of functions
suirad has quit [Quit: Page closed]
mnoronha has quit [Ping timeout: 255 seconds]
mnoronha has joined #zig
tobbez has quit [Ping timeout: 252 seconds]
tobbez has joined #zig
tobbez has quit [Ping timeout: 240 seconds]
tobbez has joined #zig
recj has joined #zig
tobbez has quit [Ping timeout: 240 seconds]
tobbez has joined #zig
tobbez has quit [Remote host closed the connection]
whatupdave has quit [Quit: Page closed]
scientes has quit [Ping timeout: 250 seconds]
mnoronha has quit [Ping timeout: 250 seconds]
mnoronha has joined #zig
__Myst__ has quit [Ping timeout: 255 seconds]
gunnarahlberg has quit [Ping timeout: 240 seconds]
__Myst__ has joined #zig
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
fsateler has joined #zig
fsateler_ has quit [Ping timeout: 255 seconds]
tobbez has joined #zig
Hejsil has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
<Hejsil> suirad I didn't get it to work, but I noticed that you pass the pointer to the function and not the function itself. When I looked in gdb i noticed that __unamed2 was the function that crashes, but __unamed2 is a variable and not a function. https://godbolt.org/z/LNMG-V
<Hejsil> My fix makes your code crash with "Program received signal SIGILL, Illegal instruction."
return0e_ has joined #zig
return0e has quit [Ping timeout: 250 seconds]
mnoronha has quit [Ping timeout: 268 seconds]
mnoronha has joined #zig
<nbjoerg> W^X?
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
_whitelogger has joined #zig
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
dewf has quit [Quit: Leaving]
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
ltr_ has quit [Remote host closed the connection]
kristate has joined #zig
__Myst__ has quit [Ping timeout: 246 seconds]
__Myst__ has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 250 seconds]
Hejsil has quit [Ping timeout: 256 seconds]
mnoronha has joined #zig
halosghost has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
noonien has joined #zig
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
kristate has joined #zig
Akuli has joined #zig
<Akuli> how do i std.debug.warn a pointer to a struct?
<andrewrk> Akuli, doesn't it work with "{}" ?
<Akuli> no, it creates a huge error
<Akuli> let me try to create a simpler test case
<Akuli> andrewrk, self
<Akuli> oops
<Akuli> andrewrk, https://termbin.com/pm58
<Akuli> i just want to print the address of the pointer
<Akuli> i mean, i want to print what "%d" with (int)(uintptr_t)the_pointer would do in c
<bheads> does printing with @ptrToInt(self) work?
<Akuli> yes, and that answers my question :D thanks
<bheads> np, but print should handle the prt correctly
<andrewrk> I think it might be a regression
<andrewrk> hmm I think it's just inability to print a []u32 field
<andrewrk> anyway the answer to your question Akuli is {*}
<andrewrk> forces printing as pointer
<Akuli> :D nice
<andrewrk> by default, single-item pointers of structs will just try to print the struct value
<andrewrk> and fmt can't handle printing []u32 fields yet
<andrewrk> (just nobody had needed that yet and made a pull request)
kristate has quit [Ping timeout: 252 seconds]
Zaab1t has joined #zig
tgschultz has quit [Read error: Connection reset by peer]
tgschultz has joined #zig
mnoronha has quit [Ping timeout: 244 seconds]
mnoronha has joined #zig
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 244 seconds]
MajorLag has quit [Ping timeout: 252 seconds]
daurnimator has quit [Ping timeout: 250 seconds]
daurnimator has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
Ichorio has joined #zig
Zaab1t has quit [Ping timeout: 245 seconds]
<Akuli> are "return blah();" and "return try blah();" different if blah returns an error union? does errdefer run in the one without try?
mnoronha has quit [Ping timeout: 255 seconds]
daurnimator has quit [Quit: WeeChat 2.3]
<andrewrk> Akuli, they're equivalent. when you return an error union, zig checks if the error union is an error, and if so, runs errdefers
<Akuli> nice
daurnimator has joined #zig
Akuli has quit [Quit: Leaving]
Sahnvour has joined #zig
<Sahnvour> hi
<andrewrk> hi Sahnvour
<Sahnvour> it seems like having optional comptime_int is not supported, do we want this to be legal or not ?
<andrewrk> yes
<andrewrk> it should be legal
<Sahnvour> that's the issue behind https://github.com/ziglang/zig/issues/2030
<Sahnvour> I guess the `orelse` emits IR than contains a ptr load, and it ends up crashing
daurnimator has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
Sahnvour has quit [Ping timeout: 256 seconds]
daurnimator has joined #zig
Sahnvour has joined #zig
<Sahnvour> andrewrk: the compiler panics when trying to unwrap a ?comptime_int because it is a field access, it works fine with a local variable instead. I don't really know where to look, any idea ?
<andrewrk> I'll take a look
<Sahnvour> great
marmotini_ has joined #zig
<andrewrk> Sahnvour, this passes for me: https://clbin.com/CEvFl
<andrewrk> what's your test case?
<Sahnvour> the one provided in https://github.com/ziglang/zig/issues/2030
<andrewrk> Sahnvour, the type field of a comptime value is wrong
<andrewrk> the compiler is trying to do a pointer reinterpret of a *usize to a *comptime, which doesn't make sense and is crashing
<andrewrk> I searched for "entry_usize" and found some hits in the typeinfo code
<andrewrk> well just one hit in the offset field
<Sahnvour> uh-oh
<andrewrk> that fixed the test
<Sahnvour> indeed, sorry I missed this one in my commit
<andrewrk> no worries
<andrewrk> want to do the PR?
<Sahnvour> ok
dewf has joined #zig
mnoronha has quit [Ping timeout: 246 seconds]
kristate has joined #zig
mnoronha has joined #zig
halosghost has quit [Quit: WeeChat 2.4]
mnoronha has quit [Ping timeout: 250 seconds]
mnoronha has joined #zig
kristate has quit [Ping timeout: 240 seconds]
mnoronha has quit [Ping timeout: 250 seconds]
mnoronha has joined #zig
scientes has joined #zig
Ichorio has quit [Ping timeout: 252 seconds]
Sahnvour has quit [Ping timeout: 256 seconds]
develonepi3 has quit [Remote host closed the connection]
mnoronha has quit [Ping timeout: 255 seconds]
mnoronha has joined #zig
scientes has quit [Remote host closed the connection]
scientes has joined #zig
shawn_ has joined #zig
mikdusan has joined #zig
scientes has quit [Ping timeout: 244 seconds]
<mikdusan> hi is there an option to run this test command with multiple cores? zig build --build-file build.zig test-compile-errors
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
<andrewrk> mikdusan, not yet. https://github.com/ziglang/zig/issues/331
darithorn has joined #zig
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
marmotini_ has quit [Ping timeout: 252 seconds]
shawn_ is now known as scientes