News for hackers. Stuff that matters.
Re:Be Nice and Write Stable Code by earenndil on Tuesday July 24, 2018 @03:14AM (#17598763)
What if:

* Function order changes

* Prototype goes from int function(char * ); to int function(char * arg);

* Typedef is added so instead of int function(char* );, it's typedef char* str; int function(str);

Re:Be Nice and Write Stable Code by flukus on Tuesday July 24, 2018 @04:23AM (#17599081)
Good points, the second one in particular I don't think could be fixed without a full parser. Function order changes could possibly be worked around by a formatter/linter that can reorder functions, at the risk of creating more issues. The last could be handled be passing the code through the preprocessor (the -E flag in gcc) first.

By this point it's probably gone beyond the "perfect is the enemy of good" threshold though.

Re:Be Nice and Write Stable Code by earenndil on Tuesday July 24, 2018 @04:41AM (#17599152)
> The last could be handled be passing the code through the preprocessor (the -E flag in gcc) first

Nope, that only handles preprocessor directives (essentially, any line starting with '#'). Typedefs are handled by the parser.

Re:Be Nice and Write Stable Code by LukeShu on Tuesday July 24, 2018 @12:56PM (#17602852)
That's still going to be way "less perfect" than diffing the output of `javap` or `godoc` or probably even the `help(module)` for a Python module.

The ability to diff APIs objectively gets better when we switch away from C header files.