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
[EMAIL PROTECTED]
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make