Originally posted by betam4x
View Post
Announcement
Collapse
No announcement yet.
Linus Rejects "Size Of Member" Change From Linux 5.5 Kernel
Collapse
X
-
Originally posted by kpedersen View PostI don't know if this belongs in stddef.h; possibly nonstandard/linux/defs.h?
This MACRO isn't too daft though; the one I possibly wish they would stop using is offsetof. This is non-standard code and requires hacks in the compiler itself (currently just clang and gcc support it).
Originally posted by brainlet_pederson
Fortunately, unlike you, the kernel developers realize that offsetof has been part of standard C for 20 years (since ISO C99).
....do you even code bro?
Also, did you go through the entire sign up process with the name brainlet_pederson just so you could make one post and be an asshole? pretty sad bro
Comment
-
Originally posted by microcode View PostI have read the standard, but the standard came after the language. Structs are records, records have fields, structs might have members, but members are fields.
In any case, we're not actually disagreeing. I wasn't as clear as I could have been - I was trying to say that it's more usual/expected when dealing with something in a specific context (C code vs. programming concept) to use the name of that context. For instance, it would be correct to call a structure a record in the context of C code, though perhaps a little unusual. As long as terminology is consistent, I don't think it actually matters though.
Originally posted by MaxToTheMax View PostAlso, did you go through the entire sign up process with the name brainlet_pederson just so you could make one post and be an asshole? pretty sad bro
- Likes 1
Comment
-
Originally posted by brainlet_pedersonNo part of his statement is "right". A standard language feature of 20 years is not a "hack", nor does offsetof() require anything resembling a hack to implement. At least half a dozen other compilers (in addition to GCC and Clang) support it.
Code:#define offsetof(st, m) ((size_t)&(((st *)0)->m))
The QuakeC language is not C and was only designed for use in a single application (where standards compliance is irrelevant).
https://github.com/tastyspleen/r1q2-...g_local.h#L508
https://github.com/ioquake/ioq3/blob...g_local.h#L695
Quake 2 and 3 don't employ QuakeC at all. I spent many years working with this family of game engines, don't try to correct me on this
Why do you keep trying to state a point about C by mentioning every language except C? C++ is not C.
The sign-up process takes 10 seconds. It was worth it to correct a cocky c*nt being wrong on the internet...Last edited by MaxToTheMax; 12 December 2019, 12:55 PM.
Comment
Comment