News for hackers. Stuff that matters.
Re:OpenSSL 3.0.7 Published by nurettin on Tuesday November 01, 2022 @12:36PM (#33423588)
sizeof is a keyword because of some terrible reason, but I'd parenthesize it just to make the intention clear.
Re:OpenSSL 3.0.7 Published by Sohcahtoa82 on Tuesday November 01, 2022 @12:55PM (#33423856)
Agreed. sizeof FEELS like a function, and so I use parentheses with it, even though I know it's not actually a function.
Re:OpenSSL 3.0.7 Published by krylon on Tuesday November 01, 2022 @04:32PM (#33427088)
Wasn't there some subtle difference between using sizeof with vs without parens? Something like if you pass a type to sizeof -- e.g. sizeof(*int) -- you must use parents anyway? It's been years since I've used C, I'm probably not remembering it correctly.
Re:OpenSSL 3.0.7 Published by scatters on Tuesday November 01, 2022 @09:16PM (#33430251)
Yes, exactly that. `sizeof(int)` OK, `sizeof(i)` OK, `sizeof i` OK, `sizeof int` not OK. One of those weird rules.
Re:OpenSSL 3.0.7 Published by sapiogram on Tuesday November 01, 2022 @01:05PM (#33424010)
Why is sizeof a terrible keyword? Just think of it as an operator rather than a function.
Re:OpenSSL 3.0.7 Published by nurettin on Wednesday November 02, 2022 @12:42AM (#33431520)
Should have been a callable, or should have had consistent syntax to prevent people from being clever.