Compiler builtins/included headers
Posted: Sat Jan 15, 2011 7:25 pm
Hi,
I've been filling in some of the edges of my C library, and I realized that many architecture-specific headers (like stdint.h, float.h) are not defined in the C library (at least not glibc), and are instead packaged with the compiler, and use compiler builtin macros for portability. Is it standard practice to not write these headers and leave them to the C compiler? Are these headers guaranteed to exist for every compiler, or are they a GNU extension?
Also, I've been working on my math library, and while I finished C89 support and my functions have very high accuracy, they are extremely slow in comparison to the compiler builtins when I test them under Linux. I'm going to be using CLang and GCC pretty much exclusively for building my OS, so is it okay to use the builtins in my OS? (I'm checking for __GNUC__ of course) Are there GPL issues with this?
Thanks,
Nick Johnson
I've been filling in some of the edges of my C library, and I realized that many architecture-specific headers (like stdint.h, float.h) are not defined in the C library (at least not glibc), and are instead packaged with the compiler, and use compiler builtin macros for portability. Is it standard practice to not write these headers and leave them to the C compiler? Are these headers guaranteed to exist for every compiler, or are they a GNU extension?
Also, I've been working on my math library, and while I finished C89 support and my functions have very high accuracy, they are extremely slow in comparison to the compiler builtins when I test them under Linux. I'm going to be using CLang and GCC pretty much exclusively for building my OS, so is it okay to use the builtins in my OS? (I'm checking for __GNUC__ of course) Are there GPL issues with this?
Thanks,
Nick Johnson