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/
<g-w1> Module.Function(name=start): @0: void = {}; %0: u8 = arg(a) %1: noreturn = ret(@0)
<g-w1> ah, i just need to hijack Sema.analyzeRet
<g-w1> lets uncomment those tests!
<g-w1> all cbe tests - 1 are passing! lets go
ur5us has joined #zig
bens has joined #zig
dimenus has quit [Ping timeout: 240 seconds]
brzg has joined #zig
sundbp has quit [Ping timeout: 246 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
<andrewrk> sweet
<andrewrk> are all the tests uncommented now?
<andrewrk> all I see are updated (improved) and new test cases with a diff against master :D
<g-w1> well the optionals regressed before zir-memory-layout
<andrewrk> we should try to hit full test coverage on compile errors
<andrewrk> (eventually)
<g-w1> yep, \/\/.*\\ is only showing the optionals :D
<andrewrk> sweet! those @panic calls in Module.byteOffset are revealing some missing compile error test coverage
<g-w1> ah yeah, we need builtin_arg_2 right/
<andrewrk> that's not zir-memory-layout's fault tho
artmb has joined #zig
artmb has quit [Ping timeout: 258 seconds]
nvmd has quit [Quit: Later nerds.]
brzg has quit [Quit: leaving]
gazler__ has joined #zig
gazler_ has quit [Ping timeout: 240 seconds]
earnestly has quit [Ping timeout: 268 seconds]
ShockTohp has joined #zig
<g-w1> could someone help me port this asm to zig? its arm and im having trouble https://clbin.com/1erDf
<g-w1> i think since its all on one line its confusing me
waleee-cl has quit [Quit: Connection closed for inactivity]
leon-p has quit [Quit: leaving]
<andrewrk> idk what %= does in gcc inline asm
andreao has joined #zig
<andrewrk> I think that's just a for loop from 0 to count
<andrewrk> it just wastes time and the optimizer can't get rid of it because it's inline asm
<andrewrk> g-w1, there's a better way to do that, without inline asm
<andrewrk> what's the context for this?
<g-w1> i figured it out https://paste.rs/IWj
<g-w1> context is osdev tutorial
<g-w1> %= iterates a number so that you can have the same thing multiple times; it also works in zig
<g-w1> eg: 000087a8 <__delay_0>:
<g-w1> i am trying to do this tutorial: https://wiki.osdev.org/ARM_RaspberryPi_Tutorial_C in zig with the raspberry pi 0. it tells me to run this arm-none-eabi-gcc -mcpu=arm1176jzf-s -fpic -ffreestanding -c boot.S -o boot.o, but when I do -mcpu=arm1176jzf-s in zig build-obj i get error: Unknown CPU: 'arm1176jzf' (i already asked on embedded zig discord server, want to know if anyone here has some more thoughts)
<andrewrk> g-w1, seen this yet? https://github.com/andrewrk/clashos
<g-w1> oh lol
<g-w1> thanks so much
<g-w1> between daintree and this and osdev wiki i think i have enough materials to learn
<andrewrk> I knew that snippet looked oddly familiar :)
<g-w1> does gcc have different mcpu options than clang/llvm?
<andrewrk> probably some, but clang attempts to be drop-in compatible with gcc
<g-w1> ok interesting, ill have to investigate
<g-w1> oh it looks like zig wants generic+feature while gnu is satisfied with arm1176jzf-s
<andrewrk> `-target arm-freestanding -mcpu=arm1176jzf_s` looks like it works to me
<g-w1> hm
<g-w1> ah gcc had - while clang needs _ ig
<andrewrk> I believe this is zig being intentionally incompatible with both clang and gcc
<g-w1> why?
<andrewrk> so you can put the identifier in your code without @"" syntax
<g-w1> ah, interesting
artmb has joined #zig
nycex has quit [Remote host closed the connection]
artmb has quit [Ping timeout: 245 seconds]
nycex has joined #zig
ur5us has quit [Ping timeout: 258 seconds]
[RMS] has quit [Quit: No Ping reply in 180 seconds.]
[RMS] has joined #zig
artmb has joined #zig
sord937 has joined #zig
<andrewrk> zir-memory-layout branch is done
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
artmb has quit [Ping timeout: 246 seconds]
mokafolio has quit [Client Quit]
<andrewrk> and merged
<ikskuh> :O
andreao has quit [Quit: The Lounge - https://thelounge.chat]
andreao has joined #zig
tnorth has joined #zig
andreao1 has joined #zig
andreao has quit [Ping timeout: 260 seconds]
andreao1 is now known as andreao
mokafolio has joined #zig
yyp has joined #zig
earnestly has joined #zig
sundbp has joined #zig
artmb has joined #zig
artmb has quit [Ping timeout: 246 seconds]
<ifreund> andrewrk: \o/
<ifreund> and nope I fell alseep before actually getting anything done last night :D
aerona has quit [Quit: Leaving]
waffle_ethics has quit [Read error: Connection reset by peer]
waffle_ethics has joined #zig
cole-h has quit [Ping timeout: 268 seconds]
andreao5 has joined #zig
andreao has quit [Ping timeout: 240 seconds]
andreao5 is now known as andreao
yyp has quit [Ping timeout: 240 seconds]
yyp has joined #zig
daex_ has joined #zig
daex has quit [Ping timeout: 268 seconds]
yyp has quit [Quit: now it's safe to turn off your computer]
waleee-cl has joined #zig
daex_ is now known as daex
artmb has joined #zig
artmb has quit [Ping timeout: 240 seconds]
artmb has joined #zig
artem1 has joined #zig
artmb has quit [Ping timeout: 265 seconds]
artem1 has quit [Ping timeout: 260 seconds]
artem1 has joined #zig
wilsonk__ has quit [Quit: Leaving]
dyeplexer has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
artem1 has joined #zig
wilsonk has joined #zig
leon-p has joined #zig
notzmv has quit [Ping timeout: 260 seconds]
artem1 has quit [Ping timeout: 260 seconds]
artem1 has joined #zig
gpanders has joined #zig
jokoon has joined #zig
nycex has quit [Ping timeout: 240 seconds]
jokoon has quit [Quit: Leaving]
nycex has joined #zig
qbit has quit [Quit: leaving]
qbit has joined #zig
meatcar has quit [Ping timeout: 252 seconds]
meatcar has joined #zig
jcmdln has joined #zig
notzmv has joined #zig
nycex- has joined #zig
nycex has quit [Ping timeout: 240 seconds]
andreao2 has joined #zig
andreao has quit [Ping timeout: 240 seconds]
andreao2 is now known as andreao
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
TheLemonMan has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
bitmapper has joined #zig
Snetry has quit [Ping timeout: 240 seconds]
sord937 has quit [Quit: sord937]
Snetry has joined #zig
cole-h has joined #zig
artem1 has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
donaldallen has joined #zig
<donaldallen> The zig language reference talks about 'extern' for calling foreign functions. In the examples, the syntax 'extern fn' and things like 'extern "c" fn' appear, but nowhere is the literal following 'extern' documented. Would someone please explain to me what the purpose of that literal is? It doesn't seem to matter in code whether I include it or not
<donaldallen> (the C libraries I need are specified to zig and so the externs get resolved at link time with or without the literal).
<ifreund> donaldallen: that string indicates the name of the library the extern function is provided by
<ifreund> if you leave it out, zig looks for the symbol in all libraries you link against
<donaldallen> Thinking the literal was the ABI, I externed some functions that were in the gtk and sqlite libraries as 'extern "c"' and there were no linking errors and the code worked. My point is that those functions weren't in libc, but they were found nonetheless. Perhaps using the literal causes linking to try the referenced library first, but if not found,
<donaldallen> search the rest? In any case, it sounds like this is simply for optimizing linking time but otherwise unnecessary?
<TheLemonMan> the part between quotes is sort-of useless if you're not targeting Windows, it only serves for the compiler to automagically add a "-l<string>" entry in the linker invocation
Akuli has joined #zig
<donaldallen> Your "sort-of-useless" comment is in line with my experience on Linux and FreeBSD. This really needs to be documented, though I'm aware that there is at least one issue outstanding related to this. Perhaps the documentation is waiting on a re-thinking of this?
<donaldallen> Thanks for the help.
donaldallen has quit [Quit: Connection closed]
artem1 has quit [Ping timeout: 258 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
andreao has quit [Ping timeout: 240 seconds]
dyeplexer has quit [Remote host closed the connection]
yyp has joined #zig
artem1 has joined #zig
donaldallen has joined #zig
donaldallen has quit [Client Quit]
artem1 has quit [Ping timeout: 246 seconds]
artem1 has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
artem1 has quit [Ping timeout: 258 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
<mikdusan> sigh - new in cmake 3.20 is another policy warning that causes those who build LLVM (12.x, haven't tried other versions), to emit >= 1000 lines of some new warning
plumm has joined #zig
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
nvmd has joined #zig
jjido has joined #zig
artem1 has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
sundbp has quit [Ping timeout: 260 seconds]
yyp has quit [Quit: now it's safe to turn off your computer]
yyp has joined #zig
earnestly has quit [Ping timeout: 265 seconds]
SimonNa has joined #zig
<g8U4Z1xGzjlm> a c library returns a char** array, how do i convert those to zig types? warn("w: {}\n", .{@ptrCast([*]u8, chararray[i])}); only outputs u8@7ff4cb9ecca0
<ifreund> are you expecting the inner char * to be a null terminated string?
<ifreund> how you convert char** to zig types depends on the semantics of the C code
<g8U4Z1xGzjlm> ah. i gotit. @ptrCast([*:0]u8, chararray[i]) was the magic.
earnestly has joined #zig
GreaseMonkey has joined #zig
Akuli has quit [Quit: Leaving]
ur5us has joined #zig
<ifreund> g8U4Z1xGzjlm: you don't need to @ptrCast() there, @as() will suffice
<ifreund> assuming that chararray is a [*c][*c]u8
<g8U4Z1xGzjlm> yeah
<g8U4Z1xGzjlm> thanks!
yyp has quit [Quit: now it's safe to turn off your computer]
ur5us has quit [Ping timeout: 258 seconds]
dfacto has left #zig ["The Lounge - https://thelounge.chat"]
nvmd has quit [Quit: Later nerds.]
earnestly has quit [Ping timeout: 240 seconds]