3 ms·
So stdint.h not available to kernel programmers. Thanks.
by alextingle 13y ago
So stdint.h not available to kernel programmers. Thanks.
- pslam 13y agoI always found this special-casing of headers for kernel vs user unnecessary and complicating. In the many embedded runtimes I maintain, I've moved towards using standard POSIX-y and C(++) standard headers everywhere. I know kernel folks love to believe that their world is special so all the usual C library stuff needs to be done differently, but it's not needed. It's so much easier to port code between the two worlds when you don't have to litter the #include prelude of every C file with conditionals.
- _kst_ 13y agostdint.h may not be available, but int64_t is; it's defined in include/linux/types.h.
- alayne 13y agoThe OpenBSD kernel probably doesn't use Linux headers.
- asveikau 13y agoA few times I got flamed on this site for complaining that the average HNer can't have reasonable discussions about C. I think the comment that the OpenBSD team should just #include <linux/types.h> pretty well shows that I was right. :-)
- _kst_ 13y agoJust a silly mistake on my part.
- cbsmith 13y agoReally going out on a limb there aren't you? ;-)
- _kst_ 13y agoYeah, good point. I'm not familiar with the OpenBSD kernel. Is there any good reason (for OpenBSD or any other kernel) why <stdint.h> shouldn't be available -- or at least why int64_t shouldn't be available in some header?