4 ms·
more portability, and some of the santiziers that clang has (ubsan, asan). They have gcc equivalents or ports but being able to use more of these kinds of tool
by simcop2387 9y ago
more portability, and some of the santiziers that clang has (ubsan, asan). They have gcc equivalents or ports but being able to use more of these kinds of tools is a good thing in the end since it'll allow more bugs to be found without an exploit.
- nullc 9y ago> and some of the santiziers that clang has (ubsan, asan) GCC has these.
- simcop2387 9y agoDo they end up finding the same issues/bugs? I thought they didn't always find the same things last I tried using them, so I'd build in both compilers to end up running tests/checks.
- CJefferson 9y agoNo sure what you mean by 'more portability'. gcc compiles to a strict subset of the architectures than llvm supports (at least, last time I checked).
- JohnStrange 9y agoYou mean superset, right?
- CJefferson 9y agoYes, and it's too late to change now, thanks.
- simcop2387 9y agoIt means that you won't end up relying on a specific compiler's quirks or implementation of the language. You can expect different compilers to handle undefined behavior in different ways which will help you catch where you're doing things you shouldn't be. And since you're no longer relying on a single compiler you are more likely to be able to support other platforms and compilers that don't have a gcc port (they do exist, even if they aren't common).
- CJefferson 9y agoYou have to rely on compiler's implementation -- you can't implement a kernel in pure C unfortunately, you need to do some things "outside" of C. In practice, most supporting of the kernel has come about by clang implementing things how gcc do them anyway.