Hello,
The GPC runtime library (RTS) does quite a bit of checking at runtime. The ISO standards dictate this.
However, these checks slow down GPC compiled programs.
Would it be a violation of the standards if we were to have two RTS libraries (libgpc.a and libgpc_g.a), where libgpc_g.a is linked if the '-g' compiler switch is used, and libgpc.a (no checks) otherwise?
This would combine the best of both worlds: checks are enabled when you debug your code, while production code has optimum speed.
Let me know your opinions,
JanJaap
--- With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC1925.
Would it be a violation of the standards if we were to have two RTS libraries (libgpc.a and libgpc_g.a), where libgpc_g.a is linked if the '-g' compiler switch is used, and libgpc.a (no checks) otherwise?
I would prefer to see the checks being standard and adding a flag to get better performance. For example, if any -O flag is used, then use the library without the checks.
Jan-Jaap van der Heijden wrote:
Hello,
The GPC runtime library (RTS) does quite a bit of checking at runtime. The ISO standards dictate this.
However, these checks slow down GPC compiled programs.
Would it be a violation of the standards if we were to have two RTS libraries (libgpc.a and libgpc_g.a), where libgpc_g.a is linked if the '-g' compiler switch is used, and libgpc.a (no checks) otherwise?
This would combine the best of both worlds: checks are enabled when you debug your code, while production code has optimum speed.
Let me know your opinions,
This sound's like a pretty good idea. As to it violating the standard, who cares? Especially if there is another option that links in libgpc_g.a even without debugging. Err, just remebered, linking and compiling can now be separate, so a nother option is not needed.
Does this mean that {$I[+-]} works now?
With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC1925.
Actually, anything can fly. It's landing that's the hard part.
Bill