help-make
[Top][All Lists]
Advanced

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

Re: generate a File-ID??


From: Tommy Nordgren
Subject: Re: generate a File-ID??
Date: Tue, 4 Jul 2006 03:45:55 +0200


3 jul 2006 kl. 20.58 skrev Torsten Mohr:

Hi,

in a large project with several source files (in C) for an
embedded target with not much ROM we want to use a self-written
"assert" that does not print out the file name (too much program
space) but uses a "file ID" that i want to hand over to the
compiler when generating the object file.

        Just keep your file names short. With suitable compiler options,
you will get only a single instance of the file name string constant.
        GCC and most other compilers can be configured to do this.
Internally, your code will then refer to the string via a pointer to the string memory,
which is incidentally the same size as an int on many machines.
With 8 character filename and four byte ints, the net cost will be of the order 5 bytes.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
address@hidden







reply via email to

[Prev in Thread] Current Thread [Next in Thread]