Live data from Hacker News

Rebuild of the Debian archive with clang

clang.debian.net

11–20 of 55 posts

Re: Rebuild of the Debian archive with clang

#11
post #2

Looks like the most comprehensive list of differences between clang and gcc. I'm amazed. Apparently, most differences are either because clang and gcc use different standards or interpret them differently. Also, only 9% of the Debian packages have issues, meaning clang is getting more and more worth considering.

If you put basic standard compliance aside, it also strips down the errors from arguable code to horrifying coding practice.

http://clang.debian.net/status.php?version=3.0&key=VARIA...

http://clang.debian.net/status.php?version=3.0&key=NON-P...

Re: Rebuild of the Debian archive with clang

#12
post #2

Looks like the most comprehensive list of differences between clang and gcc. I'm amazed. Apparently, most differences are either because clang and gcc use different standards or interpret them differently. Also, only 9% of the Debian packages have issues, meaning clang is getting more and more worth considering.

If you put basic standard compliance aside, it also strips down the errors from arguable code to horrifying coding practice. http://clang.debian.net/status.php?version=3.0&key=VARIA... http://clang.debian.net/status.php?version=3.0&key=NON-P...

What could be nice is if the error pages could suggest possible fixes for the errors that have "will never support". Might be helpful to guide bug-fixers (esp. ones that are starting out).

Re: Rebuild of the Debian archive with clang

#13
post #10

Earlier quoted context omitted.

Doesn't Apple use clang for OS X? If it does, that's as good a validation as any for me.

Another (IMHO better) validation is that FreeBSD compiles the kernel with clang: http://wiki.freebsd.org/BuildingFreeBSDWithClang

FreeBSD can compile the kernel with Clang, but at least as of 9.0-RELEASE, the default is still GCC. They're aiming to switch to Clang for as much as possible for 10.0-RELEASE, in a couple of years.

Re: Rebuild of the Debian archive with clang

#14
post #3

However this doesn't proove that clang produce error-free (was afar the compiklation goes) executables.

No one can ever prove such a thing. Neither can it be proven that gcc or any compiler for that matter produces error-free executables. What this does, however, is providing information and analysis about the quality of the clang compilation process as compared to gcc.

It can be proven, see CompCert C compiler: http://compcert.inria.fr/compcert-C.html.

Re: Rebuild of the Debian archive with clang

#15

Earlier quoted context omitted.

No one can ever prove such a thing. Neither can it be proven that gcc or any compiler for that matter produces error-free executables. What this does, however, is providing information and analysis about the quality of the clang compilation process as compared to gcc.

It can be proven, see CompCert C compiler: http://compcert.inria.fr/compcert-C.html .

That only proves that a compiler behaves according to a language definition. That does not prove the executables will behave as you expect the executables to behave, and thus there is no way knowing the executables will be error free.

Re: Rebuild of the Debian archive with clang

#16

Earlier quoted context omitted.

If you put basic standard compliance aside, it also strips down the errors from arguable code to horrifying coding practice. http://clang.debian.net/status.php?version=3.0&key=VARIA... http://clang.debian.net/status.php?version=3.0&key=NON-P...

What could be nice is if the error pages could suggest possible fixes for the errors that have "will never support". Might be helpful to guide bug-fixers (esp. ones that are starting out).

There's a clickable text on the top of those pages that points at the clang FAQ fragment suggesting possible fixes.

Re: Rebuild of the Debian archive with clang

#17
Amazing list.

I was frustrated that I didn't manage to figure out how to locate the results for a given package, if there were any.

Without that, how should I (as a package upstream owner) know if I need to fix my code, or at least analyze the results with respect to my particular package?

Re: Rebuild of the Debian archive with clang

#18
post #3

However this doesn't proove that clang produce error-free (was afar the compiklation goes) executables.

Doesn't Apple use clang for OS X? If it does, that's as good a validation as any for me.

Isn't most of their code in Objective C? Does that use clang too?

Re: Rebuild of the Debian archive with clang

#19
post #17

Amazing list. I was frustrated that I didn't manage to figure out how to locate the results for a given package, if there were any. Without that, how should I (as a package upstream owner) know if I need to fix my code, or at least analyze the results with respect to my particular package?

The build logs are all together:

http://clang.debian.net/logs/2012-01-12/

(I guess the ones with a 'b' appended are for clang)

Re: Rebuild of the Debian archive with clang

#20
post #7

Earlier quoted context omitted.

No one can ever prove such a thing. Neither can it be proven that gcc or any compiler for that matter produces error-free executables. What this does, however, is providing information and analysis about the quality of the clang compilation process as compared to gcc.

No can prove it, but at least the GCC version are actually run by people - these version and created, but never actually used. He should do some fuzz testing of these programs, with the exact same fuzz sent to the GCC versions, and then report any differences. But collecting the "results" would be hard - it's not always visible in output, you'd have to track system calls and IO.

The ideal scenario would be if upstream projects provided embedded test code with standardized hooks so that tests could be built, executed and results collected in an automated way.

Even if we started with a small test set for some projects, it would be a huge win in the long run just to have this scaffolding in place.

Any ideas on how to make a distro-agnostic testing hook?

Post reply on HN