btrask / stronglink

A searchable, syncable, content-addressable notetaking system
Other
1.04k stars 39 forks source link

New compiler warnings #59

Open btrask opened 9 years ago

btrask commented 9 years ago

My philosophy on C is that there is so much undefined behavior, we can turn it into any language we want it to be, including one focused on security. I think stand-alone static analyzers are a dead end, and the correct way to do this is by adding compiler warnings to existing mainstream compilers. The simplest and most obvious option is Clang.

Here are some warnings I'd like to see:

C can also theoretically support a stricter memory model (like AddressSanitizer or emscripten) and all sorts of cool things. There's plenty of room at the bottom!

btrask commented 8 years ago

Other ideas:

btrask commented 8 years ago

We could also use a debugger option for setting breakpoints within a line.

We use short statements on the same line as their conditional to encourage error checking and avoid "goto fail" style bugs. However, GDB at least can't set breakpoints on the statement inside of the conditional.

I looked pretty hard into this and surprisingly I couldn't find any more info on it. Perhaps LLDB supports it.