[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] C99 stuff in public GEMlib headers?



Hi,

On lauantai 17 marraskuu 2012, Roger Burrows wrote:
> On 17 Nov 2012 at 11:37, Arnaud BERCEGEAY wrote:
> PureC ignores static functions which are never referenced, i.e. does not
> generate code for them.  LatticeC does not alas, so there is huge code
> bloat when trying to use LatticeC with code that has many small modules
> (e.g. Windom).  And I don't know if there's anything in the C standard
> that says that a compiler *must* ignore static functions that are never
> referenced (although I would agree that it's logical behaviour).

It's just an optimization.  Such things might not be removed by other
compilers either, if you don't *any* enable optimization.

> There is no easy way around this, so if you use "static inline" you're
> effectively preventing the use of LatticeC (which may not be of concern
> to anyone except me ;-)).  I don't know how it affects other compilers
> apart from PureC.

As there's non-inline implementation of appl_init() in a_glue.c,
I guess one could just ifdef the static inline function out from
gem.h header.  Currently there are no such compiler specific ifdefs
in gem.h though.


	- Eero