Any C devs catch a silly mistake here? Seems like it should work? https://stackoverflow.com/questions/45268988/return-a-struct-with-string-from-a-multi-threaded-rpc-server …
Looks like it's always been that way as far as I can tell. We're just bad at C lol
-
-
No, like, I remember specific warnings about how this doesn't work. But they were from 2002, so maybe it changed?
-
Hm. But setting gcc standards mode as far back as c90 doesn't change the behavior. Okay, I'm just wrong.
- 9 more replies
New conversation -
-
-
it works here because i'm using a string literal and not a pointer to a string. So info about size is calculable at compile time
-
I don't think you're bad at C, just no one ever does this because they're aware of the possible mistake of calculating size of the pointer.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.