-
Notifications
You must be signed in to change notification settings - Fork 0
Problems
JCRL provides a very simple and clean error system: return values are all standard return codes (defined in constants.h). This makes it easy to check for failure and what kind of failure occurred. Ideally, every JCRL function call has its return value checked and any errors are caught and handled.
However, this can inflate code using JCRL by quite a bit. Not only is this bad for software maintenance and complexity, but it adds insult to injury as programmers are essentially punished for using the library safely!
- Define a macro (or set of macros) that would condense common error checking down into a single line
- Define a special function that would condense common error checking down into a single line
The first option seems like the better of the two as macros are quite flexible and don't pollute the function namespace (like the second option).
While the current build system works, it leaves a lot to be desired. Namely:
- inconsistent outputs for different versions of GCC
- (FIXED) difficult to automate unit testing (despite them existing)
- (FIXED) no sort of memory checking
- no fuzz testing
- (FIXED) no distinction between debug builds, release builds, etc.
Ideally, all of these things should be automated - i.e. integrated into each build. What would be really nice is something like:
make all
# generates object files, actual archive file, unit tests,
# memory checks (ASan), fuzz tests, etc.
- potentially rewrite the unit testing framework
- each function has its own C pair of C source files (
.h
and.c
) - each function is organised under its component
- e.g.
-
list/
list_init.h
list_init.c
list_free.h
list_free.c
- ...
-
- e.g.
- each function has its own C pair of C source files (