Jan Schaumann on Nostr: This is the first year that a lot of students rely on errno being set instead of a ...
This is the first year that a lot of students rely on errno being set instead of a library function's return value:
errno = 0;
func()
if (errno) {
error handling here
}
instead of
if ((n = func()) < 0) {
error handling here
}
What's up with that? Is AI somehow defaulting to errno checking instead of return values? Where is this trend coming from?
Published at
2026-10-17 21:19:03 UTCEvent JSON
{
"id": "ea3c880943cffde0fab768be4da51a298bdd25a41d811ded1282ebce975863e8",
"pubkey": "16b3a799044e240aa9b9c89a7d168b0d27979db63021eee1157cd7bc0c6a8f47",
"created_at": 1792271943,
"kind": 1,
"tags": [
[
"proxy",
"https://mstdn.social/@jschauma/117458334107268843",
"web"
],
[
"proxy",
"https://mstdn.social/users/jschauma/statuses/117458334107268843",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mstdn.social/users/jschauma/statuses/117458334107268843",
"pink.momostr"
],
[
"-"
]
],
"content": "This is the first year that a lot of students rely on errno being set instead of a library function's return value:\n\nerrno = 0;\nfunc()\nif (errno) {\n error handling here\n}\n\ninstead of\n\nif ((n = func()) \u003c 0) {\n error handling here\n}\n\nWhat's up with that? Is AI somehow defaulting to errno checking instead of return values? Where is this trend coming from?",
"sig": "bc4e66f86a1346fee001f136ab8fc94bd5e867352651f6a1f4ee5d8b63dce475c048cbff88685ad69fe85f9e246a123c42da37c1157cce6cb21ba0e959596c1c"
}