Marten Jan de Ruiter wrote:
I agree that explicit coding is preferable to relying on default behaviour. However, for older gpc compilers, the attribute approach does not work.
Yes, but `asmname' (except for very very old ones perhaps ;-).
Of course, I could start detecting which compiler is used, set proper environment variables, and so on.
You can test the compiler version like this. No need for extra environment variables.
{$if __GPC_RELEASE__ >= 20030303} { new external syntax } {$else} { old external syntax } {$endif}
(And `{$ifdef __GPC__}', if other compilers may be used.)
A better approach seems to be to verify which compilers are used by my colleagues. It might very well be that no older compiler is used, and I am making it hard for myself unnecessarily.
Of course, sometime you'll want to fade out the old syntax, but waiting for GPC 2.2 (e.g.) could be reasonable.
Frank
: "It would be painful to fix, but it's a lot less painful to fix _now_ : rather than later, so maybe the right thing is to just do it and : watch people scream in agony." (Linus Torvalds, LKML, 1998-10-28)