#1 2013-05-16 13:55:37

davidheffernan
Member
Registered: 2013-05-16
Posts: 22

Two hints when compiling SynPdf

I'm trying out SynPdf which on the face of it is truly wonderful.  Very well done indeed!

The compiler spits out a couple of hints when I compile SynPdf.  These hints only appear when compiling with assertions disabled, i.e. $C- mode.

[dcc32 Hint] SynLZ.pas(1087): H2077 Value assigned to 'dst_beg' never used
[dcc32 Hint] SynCommons.pas(8491): H2077 Value assigned to 'PW' never used

The hints are produced in each case because a value assigned to these variables is only referred to in an assertion.  I checked out revision 59eb20700d.

Offline

#2 2013-05-16 14:24:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: Two hints when compiling SynPdf

In fact, our policy about assertions is that they should always be compiled, even in release mode.
And we tried to make them with almost no impact about performance.
Assertions are inserted to track any algorithm-level unexpected issues, especially with potential buffer overflow, with real data "from the wild".
We rely on automated unit tests for proper regression tests.

This is why I never compiled the sources with assertions set to off.

I've added some {$ifopt C+} to remove the hints.
See http://synopse.info/fossil/info/d5e77d3d47

Thanks for the feedback and interest!
smile

Offline

#3 2013-05-16 14:43:48

davidheffernan
Member
Registered: 2013-05-16
Posts: 22

Re: Two hints when compiling SynPdf

Thanks for that.  I fully understand.

If your policy is to enable assertions in all builds, then shouldn't that be enforced in your Synopse.inc file?  That would then mean you could avoid the messy $ifopt.

Offline

#4 2013-05-16 14:49:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: Two hints when compiling SynPdf

Synopse.inc could be a good option.

But sometimes, our users do customize their own Synopse.inc, for various reasons.
Could make sense to work in all cases.

Offline

Board footer

Powered by FluxBB