Re:A New Development for Coverity and Heartbleed
by dbaupp on Saturday April 12, 2014 @06:54PM
(#7579510)
Typedefs in C are just aliases, so given `typedef int foo;` one can freely use `int`s and `foo`s interchangeably, i.e. no checking by the compiler.
That said, one could use actual wrapper structs around the various types.
Re:A New Development for Coverity and Heartbleed
by skybrian on Saturday April 12, 2014 @07:27PM
(#7579583)
A static analysis framework could treat certain typedefs specially since it's parsing the C code anyway.
Re:A New Development for Coverity and Heartbleed
by marshray on Saturday April 12, 2014 @09:30PM
(#7579816)
Great idea! Too bad openssl uses #define instead
Re:A New Development for Coverity and Heartbleed
by johnkeeping on Sunday April 13, 2014 @06:26AM
(#7580896)
There's also sparse[0]'s address space annotation, which Linux uses for annotating data from userspace.
Perhaps something similar could be done using typedefs in C?
[1] http://www.gwtproject.org/javadoc/latest/com/google/gwt/safe...