ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
ybogdano has quit [Remote host closed the connection]
ybogdano has joined #wayland
<pq>
emersion, I wonder if libdisplay-info should have a custom assert that cannot be disabled. I imagine many might have the idea of categorically disabling asserts when building for production.
<vyivel>
NDEBUG was a mistake
<emersion>
or just refuse to build with NDEBUG?
<pq>
that might work, weston test suite does that
<emersion>
libdisplay-info test suite also does that iirc
<pq>
weston is slowly migrating to a custom assertion API as well, so that it can print actual values rather than just the expression.
<emersion>
i see
<pq>
evidently someone managed to try to build libdisplay-info with NDEBUG, and that particular assert was surprisingly harmless to skip, as long as developers don't test with NDEBUG.
kts has joined #wayland
garnacho has quit [Quit: garnacho]
garnacho has joined #wayland
lsd|2 has joined #wayland
nerdopolis has joined #wayland
<mceier>
"assert that cannot be disabled" is just an error path. maybe libdisplay-info is misusing asserts.
mtj has quit [Quit: mtj]
<emersion>
i dont think it depends on asserts being enabled
<emersion>
still, I don't really like having them toggleable
kts has quit [Ping timeout: 480 seconds]
<pq>
mceier, an error path from which there is no sensible recovery possible.
<MrCooper>
abort()?
<pq>
yeah
rgallaispou has joined #wayland
<emersion>
i think i've used abort() in these places
<emersion>
i never use assert(0)
<kchibisov>
library should generally never abort.
<kchibisov>
Unless you want to use abort instead of assert to guide how to use library, but it really sounds like you want to save on errors.
<kchibisov>
but e.g. crashing compositor instead of error for something that won't really make a difference (likely) is probably a bit too much.
<emersion>
abort() marks unreachable code
<kchibisov>
though, if the code can not be reached then it won't be executed, so what you place there won't matter.
<pq>
kchibisov, yes, I think we know the difference.
psykose has joined #wayland
<soreau>
it's the code executed before the assert that matters.. I've found debugging is more difficult when hitting an assertation - usually have to modify the source
kts has joined #wayland
<narodnik>
when i get wl_keyboard_leave, i clear all key repeats. should i also clear all modifier keys too?
<soreau>
you can get modifiers down on keyboard enter, FWIW
<soreau>
but it probably depends on your specific case what you want to do
<narodnik>
well right now if i press super to leave the window, then when i come back, it thinks super is still pressed
<soreau>
and if you clear on leave, there's a different problem?
<narodnik>
no, i was just wondering if that's the correct thing to do
<soreau>
I guess you might want to mark mods down if any are actually pressed on enter..
<any1>
You always get the modifiers right after enter. It's in the spec. Just clear on leave
<soreau>
I think wev might have the code to get the mods on enter