Re:Writing C software without the standard library
by targ2002 on Tuesday November 29, 2016 @02:28AM
(#13061467)
I have seen colleagues have to do very similar things on embedded platforms, when there is a large pressure on price, a smaller amount of flash on an MCU will make the MCU cheaper.
Re:Writing C software without the standard library
by mhandley on Tuesday November 29, 2016 @05:07AM
(#13062076)
Even if you've got the RAM, it never hurts to improve CPU cache locality.
Re:Writing C software without the standard library
by capnfantasic on Tuesday November 29, 2016 @03:12AM
(#13061628)
> Is this ever an real issue, even on any embedded system in the last 20 years?
Ask Cisco when they cut the Linksys routers' RAM in half a few years ago. Every byte counts. Component cost savings add up when you make a few million of them.
Re:Writing C software without the standard library
by shakna on Tuesday November 29, 2016 @02:25AM
(#13061457)
AVR atmega based devices generally have about 2kb SRAM, and 32kb flash. Maybe 2kb EEPROM.
Re:Writing C software without the standard library
by m_eiman on Tuesday November 29, 2016 @02:40AM
(#13061502)
This is true, but the stdlib provided by the compilers aimed at these chips is usually very bare bones and size-optimized to begin with. So it's likely hard to save much space by reimplementing subsets of it.
Re:Writing C software without the standard library
by shakna on Tuesday November 29, 2016 @02:46AM
(#13061527)
True, but you often end up avoiding parts of the stdlib like malloc anyway, because they tend to be heavy handed on the board.
(I've never needed to remove stdlib yet).
Re:Writing C software without the standard library
by BinaryIdiot on Tuesday November 29, 2016 @04:50AM
(#13062005)
Honestly, if I can, I try to cut down on sizes of compiled binaries and even minified and combined web app code. Sure many times it's unnecessary but if I can save on bandwidth and memory typically that means I'm including less crap that can have problems, too. I see it as including far more benefits than simply getting a file size smaller.
But sometimes it can take so much extra work that it's not worth it. So gotta do the cost benefits analysis or hell if it's something you're interested in doing just do it anyway.
Re:Writing C software without the standard library
by bronxbomber92 on Tuesday November 29, 2016 @10:47AM
(#13063735)
Yes, executable size is still a modern day problem. Imagine you're shipping an OS; do you want the hundreds of thousands of executables in your system to all be a few percentage larger when you're trying to ship to a customer who may only have 16 or 32 GB of storage space?
Of course, removing libc won't be your first (or second or third or ...) step for removing bloat from a mature codebase.
Re:Writing C software without the standard library
by flukus on Tuesday November 29, 2016 @05:49PM
(#13066875)
If you'r trying to reduce bloat in this OS would be dynamically linking anyway wouldn't you? I've installed those 300MB printer drivers so I'm all for reducing bloat. This just seems to be on the extreme end of things.
Re:Writing C software without the standard library
by huhtenberg on Tuesday November 29, 2016 @03:00AM
(#13061582)
It's not a real issue, no.
It's a statement of one's professional competency.
Is this ever an real issue, even on any embedded system in the last 20 years?