Messages in this thread | | | From | Kyle Moffett <> | Subject | Re: [RFC] Splitting out kernel<=>userspace ABI headers | Date | Sat, 3 Sep 2005 12:33:53 -0400 |
| |
On Sep 3, 2005, at 11:36:22, Denis Vlasenko wrote: > Is this an exercise in academia? Userspace app which defines > uint32_t to anything different than 'typedef <appropriate int type>' > deserves the punishment, and one which does have such typedef > instead of #include stdint.h will not notice.
That's not the issue. Say I do this (which is perfectly valid on most platforms):
typedef unsigned int uint32_t; #include <linux/loop.h>
What exactly should happen? If linux/loop.h includes stdint.h to get uint32_t, then I'll get duplicate definition errors. If it omits stdint.h, then uint16_t won't be defined (because the userspace app doesn't think that it needs it) and I'll get undefined type errors. Either way, depending on the existence or nonexistence of the POSIX types in userspace-accessible kernel headers is not viable.
> All these u32, uint32_t, __u32 end up typedef-ing to same > integer type anyway...
The point is to provide a type that _isn't_ in some standard so that _we_ can define its inclusion rules. If the standards had gone and defined "Userspace must include stdint.h or define _all_ types appropriately", then we would not have had this issue, but many apps in userspace would cease to compile on standards compliant platforms.
Cheers, Kyle Moffett
-- Somone asked me why I work on this free (http://www.fsf.org/philosophy/) software stuff and not get a real job. Charles Shultz had the best answer:
"Why do musicians compose symphonies and poets write poems? They do it because life wouldn't have any meaning for them if they didn't. That's why I draw cartoons. It's my life." -- Charles Shultz
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |