From: <pa...@pj...> - 2002-11-13 20:19:23
|
Bernhard, I believe you are very correct in saying... >IMHO it's the job of the programer to develop a memory layout of his >project. Part of this layout is the position of the stack. It's not the job >of SDCC. Even the most intelligent SDCC could only do a poor job. However, the linker _should_ print a warning when the programmer has a memory layout that is obviously incorrect. That can be done quite easily, and it's a very safe thing to do. When the user doesn't specify some aspect of the memory layout, SDCC must do _something_, and this "bug" is that the defaults it uses aren't very smart. Personally, I think the default ought to be --stack-after-data for mcs51 when the user doesn't choose a memory layout, and if they know where they want the stack then they'll go to the trouble of specifying it on the command line. Unless the linker simply refuses to create output without all parameters specified, SDCC as it exists today IS making choices about the memory layout by filling in with defaults, and indeed the choices aren't very smart. But regardless of what the defaults are, simple sanity checks and warnings (with a non-default option to supress them for experts who've done something special) are almost always a good idea. I'd rather see the "bug" classified as an enhancement request... maybe someday I'll hack on the linker and add lots of sanity checks and warnings (overlapping segments, not enough memory, etc). Paul |