devkitPro / libogc

C Library for Wii and Gamecube homebrew
https://devkitpro.org/viewforum.php?f=40
Other
285 stars 69 forks source link

kprintf is GPL #75

Open magcius opened 4 years ago

magcius commented 4 years ago

libogc includes a copy of kprintf, which was distributed under the GPL, despite libogc having a license most closely matching MIT.

https://github.com/devkitPro/libogc/blob/master/libogc/kprintf.c

endrift commented 4 years ago

This could easily be rectified by just removing kvsprintf and using vsprintf instead, since that's in newlib

magcius commented 4 years ago

I seem to be having memory corruption issues using printf rather than kprintf, but that's probably something else.

WinterMute commented 4 years ago

fwiw, kprintf is here for low footprint debug usage. It wasn't intended as a general print function and shouldn't be linked under normal use. Can have a look at replacing with newlib function but it was rather intended to avoid linking in a lot of newlib machinery in particular scenarios so I'd prefer a lightweight replacement.

endrift commented 3 years ago

You might be able to replace it with nano-vfprintf from newlib then: https://github.com/devkitPro/newlib/blob/e928275566ab8168c078eadee2043a002bd9352d/newlib/libc/stdio/nano-vfprintf.c

HTV04 commented 1 year ago

Been a while since this was discussed, but has anyone considered mpaland's implementation? It's MIT licensed, doesn't depend on floating point, and seems very lightweight (only 600 LOC and intended for embedded systems).

DacoTaco commented 6 months ago

Been a while since this was discussed, but has anyone considered mpaland's implementation? It's MIT licensed, doesn't depend on floating point, and seems very lightweight (only 600 LOC and intended for embedded systems).

i took a look at this, and its more active fork @ https://github.com/eyalroz/printf, and in essence it looks good but my problem with this is that it looks to be more complex and exports the functions as printf which we already have thanks to newlib and would cause some conflicts. however, it is +/- what we need. a printf implementation that is simple, stand alone and can work even if the whole program has crashed/caused an exception as this is where kprintf is used.