2026/04/03

Newest at the top

2026-04-03 21:36:19 +0000 <tomsmeding> I guess https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result is the better link
2026-04-03 21:35:53 +0000synchromesh(~john@2406:5a00:2412:2c00:343e:4e23:bce:73a3) (Read error: Connection reset by peer)
2026-04-03 21:35:52 +0000 <tomsmeding> the manual doesn't elucidate: https://gcc.gnu.org/onlinedocs/gcc/Common-Attributes.html#index-warn_005funused_005fresult
2026-04-03 21:35:14 +0000 <monochrom> So I still don't know why! :)
2026-04-03 21:34:41 +0000 <monochrom> No warning until -O2
2026-04-03 21:34:32 +0000 <monochrom> OK I have: int main(void) {char b[100]; read(0, b, 100); ...
2026-04-03 21:33:22 +0000 <tomsmeding> not saying there are none, I just can't think of any :)
2026-04-03 21:32:44 +0000 <tomsmeding> that... has nothing to do with optimisations? fork() doesn't care whether you used -O2 if it wants to fail
2026-04-03 21:32:11 +0000 <monochrom> I forgot. I seem to recall that unused-return-value is one of them.
2026-04-03 21:31:42 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-03 21:31:37 +0000 <tomsmeding> warning about = vs == is independent of optimisations
2026-04-03 21:31:21 +0000 <tomsmeding> what kind of warnings would become more important under optimisations?
2026-04-03 21:31:00 +0000 <monochrom> At least there is a strong correlation between unoptimized and bad code working fine.
2026-04-03 21:30:54 +0000 <tomsmeding> ideologically it's a little more nuanced
2026-04-03 21:30:36 +0000 <tomsmeding> observationally, yes
2026-04-03 21:30:27 +0000 <monochrom> Ah OK. I think the two are logically equivalent. :)
2026-04-03 21:30:20 +0000 <tomsmeding> but this is from memory -- not 100% sure
2026-04-03 21:30:04 +0000 <tomsmeding> or, reformulated, they think it's not worth generating the warnings if that's the only reason for running the analysis
2026-04-03 21:29:57 +0000 <monochrom> I was guessing that it was because -O2 breaks more code under beginner mistakes.
2026-04-03 21:29:44 +0000 <tomsmeding> IIRC some of the analyses needed to produce the warnings are only computed for the benefit of particular optimisations
2026-04-03 21:29:21 +0000 <monochrom> I don't know. Is that it?
2026-04-03 21:29:07 +0000 <tomsmeding> isn't that to make ghc -O0 faster?
2026-04-03 21:28:44 +0000 <monochrom> gcc -O2 turns on more warnings than -O0. Anyone want to bring that ideology to GHC? Maybe next April 1? >:)
2026-04-03 21:25:03 +0000 <monochrom> OK I like -W now. Didn't know that it exists.
2026-04-03 21:24:00 +0000Square3(~Square@user/square) Square
2026-04-03 21:21:43 +0000absurdvoid(~absurdvoi@user/absurdvoid) absurdvoid
2026-04-03 21:20:42 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-04-03 21:20:23 +0000Guest20(~Guest20@149.3.7.235)
2026-04-03 21:19:55 +0000absurdvoid(~absurdvoi@user/absurdvoid) (Ping timeout: 268 seconds)
2026-04-03 21:16:56 +0000 <tomsmeding> (I just wrote one)
2026-04-03 21:16:55 +0000 <monochrom> But most importantly, the OOP world did not freak out and added -Wunused-return-value to their -Wall.
2026-04-03 21:16:28 +0000 <tomsmeding> ah, and 8% of the remaining cases are forkIO
2026-04-03 21:16:13 +0000 <monochrom> `char` returning the character you already know is a nicety that you have the full right to use or ignore. SImilarly to in the OOP world most methods return this so you can chain o.m1().m2().m3(). (Especially popular among the JS people.)
2026-04-03 21:15:50 +0000 <tomsmeding> well that explains :p
2026-04-03 21:15:43 +0000 <tomsmeding> nice
2026-04-03 21:15:39 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-03 21:15:35 +0000 <geekosaur> along with a lot of example code which assumed `-Wunused-do-bind` didn't exist
2026-04-03 21:15:03 +0000 <tomsmeding> adding a _ to a mapM is really not the problem
2026-04-03 21:14:44 +0000 <geekosaur> parsec by a decade, I think
2026-04-03 21:14:41 +0000 <tomsmeding> because in my (mostly pointless) following of -Wunused-do-bind in my code, 90% of the annoying cases where I add a pointless `_ <-` are for `char`
2026-04-03 21:14:21 +0000raelie(~raelie@user/raelie) (Remote host closed the connection)
2026-04-03 21:13:58 +0000 <tomsmeding> I guess. Now I wonder which came first: -Wall having -Wunused-do-binds, or parsec having char returning a Char
2026-04-03 21:13:21 +0000 <monochrom> Oh I can justify the char parser. I may have `char 'a' <|> char 'b'` now I want to know which one I got. :)
2026-04-03 21:12:28 +0000 <monochrom> No, hlint just needs to hardcode the syntax pattern of "do ... ; traverse/forM xs; ..."
2026-04-03 21:12:18 +0000 <tomsmeding> I'm already passing you the character, why return it?
2026-04-03 21:12:11 +0000finsternis(~X@23.226.237.192) finsternis
2026-04-03 21:11:55 +0000 <tomsmeding> honestly one of the reasons -Wunused-do-bind is annoying is because parsec and friends for some inscrutable reason made `char` return a Char
2026-04-03 21:11:38 +0000 <geekosaur> hlint would need to know about types instead of code heuristics to do that, though
2026-04-03 21:11:34 +0000 <monochrom> What's next, -Wall warn you about foldl vs foldl' too?
2026-04-03 21:11:20 +0000 <monochrom> Or at least, IMO it should belong to hlint.