News for hackers. Stuff that matters.
Re:Show HN: Greg – a simple “cal” clone written in C by zabzonk on Saturday October 24, 2020 @10:00AM (#24879268)
Any reason for not using C Standard Library functions such as (for example) strlen and isdigit?
Re:Show HN: Greg – a simple “cal” clone written in C by zamfofex on Saturday October 24, 2020 @11:58AM (#24879962)
Not really, to be honest!

Originally, I had written a linker script that could generate really small ELF executables, using the information I found on this website: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm...

That meant I had to implement functions for myself, including ‘write’ in x86 assembly.

As soon as I started storing function pointers, however, my program started to segfault, and I didn’t bother to figure out how to fix it. Do I stopped providing those builds on the website, and decided to start using other standard library functions, such as the time‐related functions.

Since I already had those functionalities there, I decided to keep them anyway. It would make sense to reuse the library functions, though, I agree!