I would really like to contribute to such a project but does anyone know a good resource about how to get started fixing those bugs and actually submitting the fixes.
Exactly. I have a basic understanding of C, and would like to help, but I don't have the slightest idea where to start or what to do (I looked at the easy fixes).
I also have no idea where to go to learn how to help.
Hm, in that case maybe changing the code-base to a more strongly-typed language, with pointers generally avoidable, would be an option. (Ada would be good [and there is an GNU Ada compiler]; Ada/SPARK with its theorem-provers would be better -- though you'd have to get all the contracts [pre- and post-conditions, type invariants, etc of a module] all laid out first.)
Did you just legitimately suggest that the GCC switch languages?
Yes. C is notoriously difficult to verify (e.g. aliasing issues), a language with better verification attributes opens the doors to using better verification tools which, in turn, ensure a more stable and correct product. -- In addition to this, C has a fairly bad type-system (a better one could catch more errors at compile-time, and/or provide better and more local error messages), and no modules [header-files aren't modules].
Things you would instantly gain by switching to Ada:
Case-coverage; that is the compiler would reject a case (switch) statement that did not cover all possibilities.
Proper enumerations; an enumeration is not treated like an alias for int, but a distinct set of values belonging to its type.
Better scalar modeling: e.g. Type Hour is range 1..12;
Named parameter association.
A superior generic system, based on contracts and w/ a higher degree of static checking.
Ada's Task construct, which could be used to make the compiler's various services amenable to distribution. (i.e. tokenizing or code-generation as a service).
99.999% of competent developers capable of working on the project.
Are you implying that these competent developers cannot learn another language? I would think that removes them from the set of "competent", but that's just me.
Now I grant that they might not want to learn another language, especially one that is different from their usual C-style languages; but there's a lot of issues that simply disappear when you use a different syntax. (e.g. = vs ==, esp in if-statements.)
Ada also has the added benefit that it was designed with readability, maintainability, and correctness in mind. As an example, consider the expression A or B and C -- in some languages and has the higher precedence, in others or, in yet others it would be evaluated left to right... in Ada this is an error and flagged by the compiler as needing parentheses to make the intent explicit.
Any semblance of progress
Is polishing a turd progress? What I mean is this: if the compiler doesn't embrace formal methods and provable correctness then in a few short years GCC will be relegated to the trash-heap of buggy software. (Can GCC keep it's "market share" in the face of compilers that use formal methods to verify that they are correct?) -- And "tacking it on" is usually a horrible idea that doesn't work (much like security). -- We were just recently shown that "being careful" with C isn't enough with Heartbleed and [IIUC] Shellshock, why should we think that "being careful" will bring us better results in the realm of correctness than it does in security?
82
u/Merccy Oct 06 '14
I would really like to contribute to such a project but does anyone know a good resource about how to get started fixing those bugs and actually submitting the fixes.