Post Reply 
C translator for calculator project
06-09-2019, 10:39 PM
Post: #42
RE: C translator for calculator project
(06-09-2019 09:31 PM)Druzyek Wrote:  
Quote:The weird thing about the Intel Decimal library is the huge tables repeated verbatim in various source files. Maybe that makes the code slightly faster, but it uses up a lot of precious space on a small, embedded system like a calculator.
That's interesting. Are you sure the compiler isn't smart enough to keep just one copy of the table?

Typically, the different C files are compiled individually and then the resulting object files are linked. But in C speak, those tables are declared with internal linkage (declared 'static'), so are invisible to the linker, so you'd end up with multiple copies.

Some compilers have "whole program optimization" modes, which might be able to detect they are identical and combine them, in theory.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
C translator for calculator project - Dan - 05-06-2019, 05:18 AM
RE: C translator for calculator project - ijabbott - 06-09-2019 10:39 PM



User(s) browsing this thread: 1 Guest(s)