3 ms·
As the author, I would really appreciate if you could elaborate on this comment. I'm genuinely curious, because it's the first time I hear someone saying it's
by acidx 12y ago
As the author, I would really appreciate if you could elaborate on this comment.
I'm genuinely curious, because it's the first time I hear someone saying it's poorly written to the point that it's used as an example of how not to write in C. In fact, I often hear the opposite from people that are way more skilled in C than I am.
I care a lot about code quality, both performance- and readability-wise; so much so that I regularly check the code with static analyzers, ubsan, build the project using two different compilers with a bunch of warnings turned on, and, of course, I'm always refactoring stuff so it's more readable.
If you could help me understand better what you mean specifically about "it violates C standards", I can keep improving the project.
In time, "gratuitously using unportable APIs" isn't really a fact. There are some uses here and there of unportable APIs (such as epoll, maybe a call or two to some pthread_*_np() function), but I believe it's better to support something I know inside out than a platform I have no familiarity with. Maybe "gratuitously" could be removed from that affirmation. Also, I follow the OpenSSH idea of portability, which seems to work pretty well for them: http://www.openbsd.org/papers/portability.ps http://www.openbsd.org/papers/portability.ps
- nwmcsween 12y agoAny type with a suffix _t is reserved as per POSIX but nobody really follows this so I can't blame you. Use of glibc specifics, from what I saw last time it was things like rawmemchr in place of strlen which if you look at the generated asm rawmemchr is worse and glibc specific.I would use perf and see what the bottlenecks were I doubt its strlen or even the non portable pthread np api. The use of __linux__ when you meant __GLIBC__, you shouldn't assume Linux == glibc either. I think you removed all that though. I'll look over it again tonight.