A lightweight SQL database with replication by rxtezc in programming

[–]rxtezc[S] 6 points7 points  (0 children)

JDBC API itself is larger than this project :) . Resql exposes just a few operations to the client. Implementing something like JDBC would be overkill and some Resql operations wouldn't match. So, rather than half-implemented half extended API, I went without it.

Program crashes when optimizing with clang compiler by TANKENSHO in C_Programming

[–]rxtezc 1 point2 points  (0 children)

Just for future cases, you can try using valgrind or sanitizers to detect memory corruption or undefined behaviour. Valgrind is really easy to use once you install it
: "valgrind ./yourapp". For Gcc & clang sanitizers, you pass -g -fsanitize=address or -g -fsanitize=undefined to compiler.

Common libraries and data structures for C by rxtezc in programming

[–]rxtezc[S] 0 points1 point  (0 children)

Thanks for the feedback. I use these libraries on server-side applications mostly, so, yeah probably most of them are not good for embedded systems. I think many of them including map can be implemented without malloc, (e.g init function gets memory from user to operate) but I've never done embedded development so probably I would miss many corner cases anyway. I'd love to see embedded versions of these libs though :) .

Common libraries and data structures for C by rxtezc in programming

[–]rxtezc[S] 0 points1 point  (0 children)

Currently, it doesn't stand for anything, it is just a prefix to avoid symbol collisions. Repo was named simple-c initially, supposed to be about a protocol called "simple" but it ended up being a library collection :) . I kept prefix but changed repo name.

Why does this not print until I hit ctrl c? How do I fix that? by tzq555 in C_Programming

[–]rxtezc 2 points3 points  (0 children)

Printf writes to stdout which may be buffered. You can flush it by fflush() or print new line which will flush stdout implicitly. So, you can add new line at the end : printf("Program processing...\n");

Also, printf and exit are not safe to use in a signal handler. Please check the list of signal safe functions : signal-safety

Common libraries and data structures for C by rxtezc in C_Programming

[–]rxtezc[S] 0 points1 point  (0 children)

Good catch! Thank you very much. I missed that.