Grant Jacobs wrote:
I'm beginning to see that. I've downloaded the 20030830 beta onto OSX and its a lot pickier than 20020510... :-) I suppose this version is stable enough?
Perhaps even more stable than 20020510 (if you don't use gcc-3.3.x where GPC has a known issue with predefined conditionals -- not very serious under Linux, though) since it's been around for so long now and probably rather well tested.
I've discovered that this newer version is pickier about unresolved forward references. I have a habit of creating these in the unit interface while designing a unit as code to be implemented later. GPC 20030830 insists that they are an error rather than a harmless unused reference. I've mixed feelings about that. Pedantically its perhaps the right thing to do but its killing an approach to designing units. Not that my view counts, but personally I have it generate a warning-level message only at the compile stage ("warning: XXX in interface not implemented in unit/module implementation"), with an error at the link stage if (and only if) some code tries to use that procedure, etc.) Just idle thoughts -- ignore me if I'm being a nuisance.
Well, I see it differently -- to a large degree out of bad experience from C. C compilers give warnings for many constructs that are actually wrong (or should be wrong, for any sane definition -- I'm no expert on the C standards). The result is that many C programmers just accept these warnings (which appear -- or flood -- when compiling), to be fixed later (read, never). And often they also hide the really dangerous warnings in the flood ...
IMHO, if a thing is clearly wrong, it should be an error. Warnings are for cases that the compiler can't clearly decide (such as the use of possibly undefined values), or things that are formally correct but suspicious (on request by the user) such as `;' after `then' or `a = b and c' without parentheses (which is correct if a, b and c are of Boolean type, but usually not what's intended), or dangerous/stupid dialect constructs (`absolute' variables/ initialized variables declared under `const', both from BP), and similar stuff.
(BTW, I don't claim that GPC behaves exactly like this already, but that's my goal.)
As for implementing later, you can of course comment out or `$if' out the future declarations, perhaps together with a nice comment (I myself put `@@' there) to remind you of this. In older GPC code (when GPC didn't check this) both of mine and from others, I found "dead" declarations lying around which either were meant to be implemented but never needed, or removed and the declaration forgotten.
Of course, the linker would give an error if an implemented routine was actually used, but IMHO a compiler should catch errors, so that a successfully compiled program does not run into linker problems (again, this may not always be the case yet).
Oh - one Q: have short strings been implemented yet? - it'd save me doing a minor work-around.
Not yet, but I'm considering to do them as one of the next big things, maybe at the end of this year ...
Frank