如何处理第三方库中的警告/提示? [英] How to deal with warnings/hints in third party libraries?

查看:78
本文介绍了如何处理第三方库中的警告/提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用FastReport生成报告.确实,我们为访问源代码付费.

We use FastReport for report generation. Indeed, we pay for access to the source code.

我们当前正在使用FastReport的最新稳定版本.尽管它对于我们的产品足够稳定,但是每当我编译时,我都会看到:

We are currently using the latest stable version of FastReport. And while it is stable enough for our production, whenever I compile I see this:

[dcc32 Hint] fs_iinirtti.pas(369): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] fs_iclassesrtti.pas(656): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] fs_iclassesrtti.pas(1014): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] fs_idialogsrtti.pas(159): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] fs_igraphicsrtti.pas(252): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] fs_iformsrtti.pas(429): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list

我不喜欢提示,更不用说代码中的警告了.现在,当然,H2443提示可能不是最令人烦恼的提示,但我还是想摆脱它.

I am not a fan of hints, much less warnings in my code. Now, of course, a H2443 hint is perhaps not the most troubling of hints, but I'd still like to get rid of it.

幸运的是,如果它是我们自己的代码,则H2443修复起来很简单(只需添加它要求的引用即可).但是,即使在这种情况下我们可以访问第三方源代码,突然更改它也感觉不恰当.

Fortunately, had it been our own code, a H2443 is trivial to fix (just add the reference it is asking for). But even though we have access to the third party source code in this scenario, it feels inappropriate to suddenly alter it.

所以我想知道:我应该只等待FastReport的开发人员发布没有错误的新版本还是我自己修复它,然后在发布新版本时简单地覆盖我的源文件副本?

So I wonder: Should I just wait for the developers of FastReport to release a new version without the error or should I fix it myself and then simply overwrite my copy of the source files when a new version is released?

我想从技术上讲这个问题可以推广到如何处理第三方库中的提示/警告.我曾想通知开发者,但这不是一个开源/免费软件项目,因此修复将持续数月.

I suppose this question could technically be generalised to how to deal with hints/warnings in third party libraries. I thought about notifying the developers, but this isn't an open source/free software project, so the fix won't be for months.

(公平地说,在以前的版本中,过去有很多提示,因此至少在正确的方向上有一些步骤.)

(In fairness, I should mention, that there used to be far more hints in previous versions, so at least there are steps in the right direction.)

推荐答案

这是我在Delphi开发人员中经常看到的一个常见错误(很多第三方供应商也犯了此错误).为什么每次构建项目时都要编译第三方库?

This is a common mistake I often see amongst Delphi developers (and also many 3rd party vendors do that wrong). Why are you compiling the 3rd party library every time you build your project?

使用DCU.将它们与源分开,并将库路径指向包含DCU的目录.这样不仅可以加快构建过程(因为它不会再次编译第三方资源,而是使用DCU),而且不会使来自第三方库的消息淹没您的项目.

Use DCUs. Separate them from the source and point your library path to the directory that contains the DCUs. That not only speeds up your build process (because it does not compile the 3rd party sources again but uses the DCUs) it also does not flood your project with messages from 3rd party libraries.

如果您想深入了解这些组件的源代码(根据我的经验,您通常不希望这样做),则可以将源代码添加到浏览路径中,甚至可以调试并释放您正在使用的DCU.

If you want to step into the source of these components (you often don't want that from my experience) you can add the sources to the browsing path and even make debug and release DCUs that you are using.

这篇关于如何处理第三方库中的警告/提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆