[译]LintProject-使用Visual C ++解决方案和项目提高PC-Lint的可用性
By robot-v1.0
本文链接 https://www.kyfws.com/applications/lintproject-improving-the-usability-of-pc-lint-wit-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 22 分钟阅读 - 10771 个词 阅读量 0[译]LintProject-使用Visual C ++解决方案和项目提高PC-Lint的可用性
原文地址:https://www.codeproject.com/Articles/8526/LintProject-Improving-the-Usability-of-PC-Lint-wit
原文作者:Anna-Jayne Metcalfe, -+- Beth Mackenzie -+-
译文由本站 robot-v1.0 翻译
前言
Utility to run PC-Lint on Visual C++ solutions and projects, generating XML and HTML reports of the results.
在Visual C ++解决方案和项目上运行PC-Lint的实用程序,生成结果的XML和HTML报告.
介绍(Introduction)
LintProject是一个命令行工具,旨在进行使用PC-Lint代码分析工具的过程(由(LintProject is a command line tool intended to make the process of using the PC-Lint code analysis tool (produced by) Gimpel软件(Gimpel software) )与Visual C ++项目一起使用,变得更加简单和高效.() with Visual C++ projects a little easier and more productive.)
PC-Lint分析C ++代码以识别潜在问题.与Visual C ++所提供的C ++编译器相比,它具有很高的可定制性和(PC-Lint analyses C++ code to identify potential problems. By comparison with a C++ compiler such as that provided with Visual C++, it is highly customizable and)非常(very)彻底,但是(可以理解)明显慢.它产生的输出是基于文件的,默认情况下定向到控制台,例如:(thorough, but (understandably) significantly slower. The output it produces is file based, and directed to the console by default, for example:)
--- Module: CJFlatHeaderCtrl.cpp
} CJFlatHeaderCtrl.cpp(160): error 1401:
(Warning -- member 'CCJFlatHeaderCtrl::m_bSortAsc'
(line 146, file ..\Include\CJFlatHeaderCtrl.h) not initialized by constructor)
}
CJFlatHeaderCtrl.cpp(166): error 1740:
(Info -- pointer member'CCJFlatHeaderCtrl::m_pParentWnd'
(line 150, file ..\Include\CJFlatHeaderCtrl.h)
not directly freed or zeroed by destructor -- Effective C++ #6) ---
Global Wrap-up error 900: (Note -- Successful completion, 2 messages produced)
尽管PC-Lint在分析C ++源文件和头文件是否存在潜在问题方面做得很出色,但它是一个通用的跨平台工具,因此与开发环境的集成受到限制.例如,当与Visual C ++一起使用时,可以使用PC-Lint扫描当前文件中的警告,并将结果定向到"输出"窗口,或者扫描文本文件中定义的文件列表.(Although PC-Lint does a great job of analysing C++ source and header files for potential problems, it is a generic cross-platform tool, and as such, its integration with development environments is limited. For example, when used with Visual C++, PC-Lint can be used to scan the current file for warnings and to direct the results to the Output window, or to scan a list of files defined in a text file.)
尽管在某些情况下(例如,在开发新代码时)这种集成水平已经足够了,但是如果您要对整个项目或解决方案进行完整的分析,则它并不理想.此外,由于PC-Lint不提供任何生成有关结果的有用报告的方法,因此可能难以在大量结果中发现潜在问题.(While this level of integration is just about adequate under some scenarios (for example, when developing new code), it is less than ideal if you want to perform a complete analysis of an entire project or solution. Furthermore, since PC-Lint does not provide any means of generating useful reports on the results, it can be difficult to spot potential problems amongst the mass of results.)
如果您正在处理大型项目,这些限制可能会使使用PC-Lint来分析您的代码既费时又困难,这可能会妨碍定期使用此非常有用的工具.因此,您的代码质量很可能会受到影响.(If you are working with a large project, these limitations can make using PC-Lint to analyse your code time consuming and difficult, which can potentially be a real disincentive to using this very useful tool on a regular basis. As a result, the quality of your code could well suffer.)
LintProject旨在解决其中两个问题.与PC-Lint不同,LintProject可以读取Visual C ++项目和解决方案文件.它可以针对完整的解决方案或单个项目运行:(LintProject was written to address two of these issues. Unlike PC-Lint, LintProject can read both Visual C++ project and solution files. It can be run against either a complete solution or an individual project:)
- 针对项目运行时,它将读取Visual C ++项目文件((When run against a project, it reads the Visual C++ project file ()*** .dsp,*.vcp(**.dsp, *.vcp*)**, 要么(*, or*)*** .vcproj(**.vcproj*)**),并指示PC-Lint分析哪些文件.对于每个分析的文件,都会捕获PC-Lint输出并将其记录在文本文件中,以供以后分析.(*) and instructs PC-Lint which files to analyse. For each file analysed, the PC-Lint output is captured and recorded in a text file for later analysis.*)
- 针对完整的解决方案运行时,LintProject读取Visual C ++解决方案文件((When run against a complete solution, LintProject reads the Visual C++ solution file ()*** .sln,*.vcw(**.sln, *.vcw*)**, 要么(*, or*)*** .dsw(**.dsw*)**)并递归分析其包含的项目.(*) and recursively analyses the projects it contains.*)
XML和HTML报告(XML and HTML Reports)
尽管包含分析结果的文本文件的可用性是该过程的基本结果,但是没有汇总其内容并为其编制索引的手段,但是解释结果的过程可能会很缓慢且费力.(Whilst the availability of text files containing the results of the analysis is an essential result of the process, without a means of summarizing their contents and indexing them, the process of interpreting the results is likely to be slow and laborious.)
LintProject通过编写链接到结果文件的XML和HTML报告,并指出在每个实现文件,项目和解决方案中发现了多少警告,从而为该问题提供了一种方便的解决方案:(LintProject provides a convenient solution to this problem by writing XML and HTML reports which link to the results files, and indicate how many warnings were found within each implementation file, project, and solution:)
HTML输出示例(Example HTML output)LintProject的主要设计目标是能够在运行时指示其过程.当您认为大型项目的PC-Lint分析在某些系统上需要花费大量时间时,这一点尤其重要.为了实现这一目标,LintProject生成的输出报告会随着分析的进行自动重新生成.更好的是,任何受支持的浏览器窗口(A key design aim of LintProject was to be capable of indicating its process whilst it runs. This is especially important when you consider that a PC-Lint analysis of a large project can take considerable time on some systems. To achieve this aim, the output reports produced by LintProject are automatically regenerated as the analysis progresses. Even better, any supported browser windows)(**)显示相应结果文件时,将在分析每个文件时自动刷新.这给(displaying the corresponding results files will automatically refresh as each file is analyzed. This gives)即时(immediate)对分析进度的反馈,并且被证明是非常有用的功能.(feedback on the progress of the analysis, and is proving to be a very useful feature.)
()目前,此功能仅支持Internet Explorer和派生的浏览器,例如(At present, this feature only supports Internet Explorer and derived browsers such as) 疯狂浏览器(Crazy Browser) ,(,) Avant浏览器(Avant browser) 等(, etc.)
安装(Installation)
LintProject的安装非常简单.最简单的方法就是放置可执行文件((Installation of LintProject is straightforward. The simplest method is simply to place the executable ()LintProject.exe(LintProject.exe))与PC-Lint可执行文件(() into the same folder as the PC-Lint executable ()lint-nt.exe(lint-nt.exe)).如果您想找到(). If you prefer to locate)**LintProject.exe(LintProject.exe)**在其他地方(elsewhere, the)/F(/f)开关可以用来告诉它在哪里可以找到PC-Lint可执行文件.(switch can be used to tell it where to find the PC-Lint executable.)
使用LintProject(Using LintProject)
LintProject由一个简单的命令行调用,例如:(LintProject is invoked by a simple command line, for example:)
要么(or)
有几种选择:(There are several options:)
指定LintProject可执行文件的位置.仅当LintProject与PC-Lint可执行文件安装在其他文件夹中时,才需要这样做.(Specifies the location of the LintProject executable. This is only required if LintProject is installed in a different folder from the PC-Lint executable.)
指定要使用的Lint间接文件的文件名.如果省略,(Specifies the filename of the Lint indirect file to use. If omitted,)**标准(std.lnt)**假设.(is assumed.)
指定要分析的解决方案配置.(Specifies the solution configuration to be analysed.)
指定要从分析中排除的项目的名称.(Specifies the names of projects to exclude from the analysis.)
将以下参数传递给PC-Lint可执行文件((Passes the following parameters to the PC-Lint executable ()lint-nt.exe(lint-nt.exe)).例如,(). For example,)**/l"-背景"(/l" -background")**将指示PC-Lint低优先级执行分析.(will instruct PC-Lint to perform analysis at a low priority.)
指定在分析开始时应在浏览器窗口中自动打开HTML输出.(Specifies that the HTML output should be automatically opened in a browser window when analysis starts.)
显示帮助信息.(Display help information.)
LintProject运行PC-Lint可执行文件((LintProject runs the PC-Lint executable ()lint-nt.exe(lint-nt.exe))分别在每个源文件上,指示其将输出重定向到一个文本文件,该文本文件从相应的HTML报告中链接到该文本文件.对于每个文件,使用如下命令行:() on each source file individually, instructing it to redirect its output to a text file which is linked to from the corresponding HTML report. For each file, a command line such as the following is used:)
<lint-folder>\lint-nt.exe -i"<lint-folder>" -b -u std.lnt
env-vc6.lnt -i"Debug" <source file> >Lint\<source file>.txt
**标准(std.lnt)**和(and)**env-vc6.lnt(env-vc6.lnt)**是PC-Lint安装生成的标准选项文件-后者特定于Visual C ++ 6.0项目.尽管默认情况下PC-Lint安装将仅将一个这样的文件安装到PC-Lint安装文件夹中,但是其他文件的副本在(are standard options files produced by the PC-Lint installation - the latter being specific to Visual C++ 6.0 projects. Although the PC-Lint installation will install only one such file into the PC-Lint installation folder by default, copies of the others are available in the)**nt(lnt)**子文件夹.(subfolder.)
LintProject将使用(LintProject will use)env-vc6.lnt(env-vc6.lnt)适用于Visual C ++ 5.0和6.0项目((for Visual C++ 5.0 and 6.0 projects ()<项目名称> .dsp(.dsp)),以及(), and)env-vc7.lnt(env-vc7.lnt)用于Visual C ++ .NET项目((for Visual C++ .NET projects ()<项目名称> .vcproj(.vcproj)),因此最好将您希望使用的选项文件放置在PC-Lint安装文件夹本身中.(), so it is a good idea to place the options files you expect to use in the PC-Lint installation folder itself.)
源代码(Source Code)
LintProject是使用ATL7构建的相当简单的命令行应用程序.最初使用MFC(当时为方便起见,比其他任何东西都多-用于解析Visual C ++解决方案和项目文件的类最初直接取自(LintProject is a fairly straightforward command line application built using ATL7. Originally, MFC was used (more for convenience at the time than anything else - the classes used to parse Visual C++ solution and project files were originally taken directly from) 资源整理(ResOrg) ,最初是在MFC下编写的).此后,就不再依赖MFC.(, and originally written under MFC). The dependency on MFC has since been removed.)
除了解析器和实用程序类,LintProject本质上由三个类组成-(Parser and utility classes aside, LintProject essentially consists of three classes -) CFileLintAnalyser
,(,) CProjectLintAnalyser
和(, and) CSolutionLintAnalyser
-一起控制分析指定项目或解决方案的整个过程.这些类调用PC-Lint,为其输出建立索引,并生成XML和HTML格式的输出报告(后者通过使用XSLT样式表转换XML).(- which together control the entire process of analysing the specified project or solution. These classes invoke PC-Lint, index its output, and generate output reports in both XML and HTML formats (the latter by transforming the XML using XSLT stylesheets).)
一个很早就变得明显的问题是,使用PC-Lint分析整个项目所花费的时间可能是(One issue which became apparent early on was that the time taken to analyze a complete project using PC-Lint can be)非常(very)覆盖范围广,因此意义重大.为了允许用户查看分析进度,LintProject会在分析进行时重新生成其输出报告.附加的维度是它能够在分析过程中刷新主机PC上显示其报告的任何浏览器窗口的能力(实际上相当令人着迷的是观看警告计数稳步上升…)(significant as a consequence of its depth of coverage. To allow the user to see the progress of the analysis, LintProject regenerates its output reports as the analysis progresses. An added dimension is its ability to refresh any browser window on the host PC displaying its reports as the analysis progresses (it’s actually quite mesmerizing watching the warning count steadily climb…))
实现浏览器刷新是属于"一旦您知道怎么做就容易"类别的那些技术之一.通过枚举所有(Implementing the browser refresh is one of those techniques which falls into the category of “easy once you know how”. It is achieved by enumerating all of the) WebBrowser
使用以下命令在本地计算机上打开控件(controls open on the local machine using the) SHDocVw::IShellWindows
界面(请参阅MSDN KB文章(interface (see MSDN KB article) 176792-“如何连接到Internet Explorer的运行实例”(176792 - “How To Connect to a Running Instance of Internet Explorer”) ).().)
对于检索到的每个控件,将其显示的URL与刚刚更新的报表的规范化路径名进行比较.如果它们匹配,则刷新控件,从而显示报告的更新版本:(For each control retrieved, the URL it is displaying is compared with the canonicalised pathname of the report which has just been updated. If they match, the control is refreshed, causing the updated version of the report to be displayed:)
/// Refresh all WebBrowser controls displaying the file with the given pathname
///
/// Note that this technique currently works
/// for Internet Explorer and derived browsers only
bool RefreshAllOpenBrowserWindows(const CString& sFullPathName)
{
if (sFullPathName.IsEmpty() )
{
return false;
}
// Convert the pathname to a uniform URL ready
// for comparison with the URL in each control
DWORD dwLen = _MAX_PATH;
CString sCompareURL;
if (!::InternetCanonicalizeUrl(sFullPathName,
sCompareURL.GetBufferSetLength(_MAX_PATH),
&dwLen,
ICU_BROWSER_MODE) )
{
return false;
}
sCompareURL.Replace( _T("//"), _T("///") );
sCompareURL.Replace( _T('\\'), _T('/') );
sCompareURL.MakeLower();
SHDocVw::IShellWindowsPtr shellws = NULL;
bool bSuccess = true;
try
{
// Connect to an instance of the shell
HRESULT hr = shellws.CreateInstance(__uuidof(SHDocVw::ShellWindows));
if (FAILED(hr) )
{
throw hr;
}
// Enumerate through current open windows (Internet Explorer and Explorer)
long lCount = shellws->GetCount();
for (int i = 0; i < (int)lCount; i++)
{
// Get a current open shell window
_variant_t vtIndex( (long)i);
IDispatchPtr idisp = shellws->Item(vtIndex);
if (idisp == NULL)
{
continue;
}
// Retrieve an interface to the WebBrowser control
SHDocVw::IWebBrowser2Ptr pWebBrowser = NULL;
hr = idisp->QueryInterface(IID_IWebBrowser2, (LPVOID *)&pWebBrowser);
if (pWebBrowser != NULL)
{
// Which URL is it displaying?
_bstr_t bsURL = pWebBrowser->GetLocationURL();
CString sURL((LPCTSTR)bsURL);
sURL.MakeLower();
// Compare the browser URL to the url to be refreshed
if (sURL == sCompareURL)
{
// This WebBrowser control is displaying the file
// we're interested in, so refresh it
hr = pWebBrowser->Refresh();
if (SUCCEEDED(hr))
{
TRACE("browser refreshed correctly\n");
}
}
}
}
}
catch(...)
{
// There's been a problem during the enumeration
bSuccess = false;
}
// Clean-up
shellws.Release();
return bSuccess;
}
不幸的是,该技术仅适用于Internet Explorer和派生的浏览器.当然,类似的技术也可以与任何其他提供COM界面以及在系统级别枚举打开的窗口的方法的浏览器一起使用.如果有人知道适用于Mozilla,Firefox和Opera的可比接口,我们将非常有兴趣了解它们.(Unfortunately, this technique works only for Internet Explorer and derived browsers. Similar techniques could, of course, be used with any other browser which offers a COM interface and a method of enumerating open windows at a system level. If anyone knows of comparable interfaces which will work for Mozilla, Firefox, and Opera, we would be very interested to hear about them.)
最后,尽管出现了相反的情况,但LintProject是单线程的.尽管可以编写它以产生多个分析线程(例如(Finally, despite appearances to the contrary, LintProject is single threaded. Whilst it could have been written to spawn multiple analysis threads (as) 视觉棉绒(Visual Lint) 的确如此),考虑到它最初的目标用途是使用通宵构建,因此这似乎不会造成额外的复杂性.(does), the extra complexity this would cause just did not seem worthwhile, given its original target use of running with an overnight build.)
常问问题(FAQ)
我可以自己使用LintProject吗?(Can I Use LintProject on its Own?)
不可以.要使用LintProject,您必须拥有PC-Lint的许可副本.请联系(No. To use LintProject, you must have a licensed copy of PC-Lint. Please contact) Gimpel软件(Gimpel Software) 用于订购PC-Lint的信息.(for ordering information for PC-Lint.)
LintProject支持哪些平台?(Which Platforms does LintProject Support?)
LintProject应该在支持Windows 2000或更高版本的任何系统上运行.此限制仅是使用Win32函数的结果(LintProject should run on any system supporting Windows 2000 or later. This restriction is solely the result of the use of the Win32 function) SHCreateDirectoryEx()
;如果您需要在Windows 9x上运行的LintProject版本,请与我们联系,我们很乐意为您准备没有此限制的版本.(; if you need a version of LintProject which runs on Windows 9x, please contact us and we will be happy to prepare a version without this restriction.)
LintProject兼容哪些Visual C ++版本?(Which Versions of Visual C++ is LintProject Compatible With?)
LintProject与Visual C ++ 5.0\6.0,Visual Studio .NET 2002\2003\2005和2008以及eMbedded Visual C ++ 4.0的项目和解决方案兼容.(LintProject is compatible with projects and solutions for Visual C++ 5.0, 6.0, Visual Studio .NET 2002, 2003, 2005, and 2008, as well as eMbedded Visual C++ 4.0.)
LintProject源代码的编译需要Visual C ++ .NET 2003或更高版本.(Compilation of the LintProject source requires Visual C++ .NET 2003 or later.)
LintProject需要什么配置?(What Configuration does LintProject Require?)
没有.只需将可执行文件与PC-Lint可执行文件放在同一文件夹中即可((None. Simply place the executable into the same folder as the PC-Lint executable ()lint-nt.exe(lint-nt.exe)),它应该会很愉快地工作.(), and it should work quite happily.)
如果您想找到(If you prefer to locate)**LintProject.exe(LintProject.exe)**在其他地方(elsewhere, the)/F(/f)开关可以用来告诉它在哪里可以找到PC-Lint可执行文件.(switch can be used to tell it where to find the PC-Lint executable.)
我可以将自己的参数传递给PC-Lint可执行文件吗?(Can I Pass my Own Parameters to the PC-Lint Executable?)
是.您可以使用(Yes. You can use the)/升(/l)切换直接将参数传递给(switch to pass parameters directly to)lint-nt.exe(lint-nt.exe).(.)
我已经安装了Windows XP Service Pack 2,并且报告中的某些链接不起作用(I have Windows XP Service Pack 2 Installed, and Some of the Links in the Reports Don’t Work)
这是Windows XP SP2中引入的"本地计算机区域锁定"策略的直接结果,该策略阻止了在本地访问HTML页面时运行活动内容(包括JavaScript代码,该代码包含在HTML报告中以提供表排序功能). .(This is a direct result of the “Local Machine Zone Lockdown” policy introduced in Windows XP SP2, which prevents active content (including JavaScript code, which is included in the HTML reports to provide table sorting facilities) from running when HTML pages are accessed locally.)
以下文章讨论锁定及其含义:(The following articles discuss the lockdown and its implications:)
- XP SP2如何影响本地计算机(How XP SP2 Affects the Local Machine)
- 本地计算机区域锁定(Local Machine Zone Lockdown) 根据我们已阅读的文章,(According to the articles we’ve read on this, it)应该(should)可以通过在生成的HTML中添加" Web的标记"(使用Microsoft术语)来避免这种情况.不幸的是,到目前为止,这已被证明是不可靠的或具有有害的副作用.我们将继续寻找一种方法来规避此限制,但目前,可以很简单地解决此问题,方法是在警告出现时单击信息栏,然后选择"允许阻止的内容"选项,或选中"允许" Internet选项的"高级"页面上的"要在"我的电脑"上的文件中运行的活动内容"选项:(be possible to circumvent this by adding “The mark of the Web” (in Microsoft terminology) to the generated HTML. Unfortunately, so far, this has proved unreliable or has had unwanted side effects. We will continue to look for a way to circumvent this restriction, but for now, it can be worked around quite simply by either clicking on the Information Bar when the warning appears and selecting the “Allow Blocked Content” option, or checking the “Allow active content to run in files on My Computer” option in the “Advanced” page of Internet Options:)
请注意,此问题仅影响Internet Explorer.其他浏览器应不受影响.(Note that this issue only affects Internet Explorer. Other browsers should be unaffected.)
LintProject需要哪些其他系统DLL,以及什么版本?(Which Additional System DLLs does LintProject Require, and What Versions?)
LintProject需要MSXML2或更高版本才能生成HTML报告.尽管默认情况下应将其安装在Windows XP系统上,但可以根据需要通过安装XML SDK(随Platform SDK附带)进行手动安装.(LintProject requires MSXML2 or later to generate HTML reports. Although it should be installed by default on Windows XP systems, it can be manually installed, if necessary, by installing the XML SDK (supplied with the Platform SDK).)
除了MSXML,LintProject不应要求安装任何其他系统DLL.如果您在系统上使用它有困难,请告诉我们.(Aside from MSXML, LintProject should not require any additional system DLLs to be installed. Please let us know if you have difficulties using it on your system.)
最后…(Finally…)
LintProject的原始版本由Anna在职期间撰写.(The original version of LintProject was written by Anna during her employment at) 索纳达国际有限公司(Sonardyne International Limited) .我们要感谢他们(特别是Bruce Baker和Richard Baldock)同意将源的所有权转让给我们,以便我们可以维护和进一步开发它.(. We would like to express our gratitude to them (and in particular, Bruce Baker and Richard Baldock) for agreeing to release ownership of the source to us so that we could maintain and further develop it.)
LintProject是免费软件.您可以不受限制地使用它,只要代码和样式表中的所有版权声明均保持不变即可.我们希望它被证明对您和我们一样有用,并且欢迎您提出有关未来增强和改进的建议.(LintProject is freeware. You may use it without restriction, provided all copyright notices in the code and stylesheets remain intact. We hope it proves to be as useful to you as it has to us, and we welcome your suggestions for future enhancements and improvements.)
有关LintProject的最新信息,请访问(For the latest information on LintProject, please visit the) Riverblade网站(Riverblade website) .(.)
版本记录(Version History)
1.4.1.13版(2009年1月)(Version 1.4.1.13 (January, 2009))
- 从VS2002开始进行修改以支持$(PlatformName).感谢Alex McCarthy所做的这些更改.(Modifications to support $(PlatformName) with VS2002 onwards. Our thanks to Alex McCarthy for contributing these changes.)
- 现在,如果命令行中出现错误,LintProject将返回错误代码1.感谢Brett Rowbotham所做的更改.(LintProject now returns an error code of 1 in the event of an error in the command line. Our thanks to Brett Rowbotham for contributing this change.)
- 现在,项目报告中的经过时间值可以显示小时以及分钟和秒(以防止报告耗时超过一个小时的项目报告经过的时间不正确).感谢Brett Rowbotham所做的更改.(The elapsed time value in project reports now shows hours as well as minutes and seconds (preventing an incorrect elapsed time from being reported for projects which take over an hour to analyse). Our thanks to Brett Rowbotham for contributing this change.)
- 删除未使用的(Removed the unused)LintProject.h(LintProject.h).(.)
- 更新了MSXML导入(Updated the MSXML import in)**stdafx.h(stdafx.h)**从(from)**msxml2.dll(msxml2.dll)**至(to)**msxml4.dll(msxml4.dll)**并添加了(and added the)
named_guids
限定词.(qualifier.) - 支持$(SolutionDir)和$(ProjectName)的修改.感谢Alex McCarthy所做的这些更改.(Modifications to support $(SolutionDir) and $(ProjectName). Our thanks to Alex McCarthy for contributing these changes.)
- 在中删除了多余的声明(Removed a redundant declaration in)CFileLintAnalyser(CFileLintAnalyser).(.)
- 已变更(Changed)**LintProject.zip(LintProject.zip)**至(to)**LintProject_1.4.zip(LintProject_1.4.zip)**在(in)MakeZip.bat(MakeZip.bat).(.)
版本1.4.0.10(2008年7月)(Version 1.4.0.10 (July, 2008))
- 删除了所有MFC依赖项. LintProject现在直接使用ATL 7,因此,源代码现在需要Visual Studio .NET 2003或更高版本进行编译(为Visual Studio .NET 2003和Visual Studio 2008提供了项目文件,但是移植到其他版本应该很简单).(Removed all MFC dependencies. LintProject now uses ATL 7 directly, and in consequence, the source now requires Visual Studio .NET 2003 or later to compile (project files are supplied for Visual Studio .NET 2003 and Visual Studio 2008, but porting to other versions should be straightforward).)
- 将内部版本转换为Unicode.(Converted the build to Unicode.)
- 添加了对eMbedded Visual C ++ 4.0工作区和项目的支持.(Added support for eMbedded Visual C++ 4.0 workspaces and projects.)
- 现在在分析过程中设置解决方案和项目特定的环境变量$(SolutionDir),$(ProjectDir),$(InputDir)和$(ConfigurationName).感谢Andrej Pohlmann提供的代码以实现此功能.(Solution and project specific environment variables $(SolutionDir), $(ProjectDir), $(InputDir), and $(ConfigurationName) are now set during analysis. Our thanks to Andrej Pohlmann for contributing the code to implement this feature.)
- 如果是形式的文件(If a file of the form)**.options.lnt(.options.lnt)**可以在项目文件夹中找到,现在将在分析命令行中使用它.感谢Andrej Pohlmann提供的代码以实现此功能.(is found in the project folder, it will now be used in the analysis command line. Our thanks to Andrej Pohlmann for contributing the code to implement this feature.)
- 添加了对解决方案/项目配置的错误检查(现在尝试分析无效的配置将导致生成错误).(Added error checking for solution/project configurations (attempting to analyse an invalid configuration will now cause an error to be generated).)
- Visual C ++ 6.0项目((Visual C++ 6.0 project ()*** .dsp(**.dsp*)**)仅包含一个项目配置的文件现在可以正确解析.(*) files containing only one project configuration are now parsed correctly.*)
- 添加了一个(Added a)**/排除(/exclude)**参数,以允许将指定的项目排除在分析范围之外(感谢Andrej Pohlmann提供了实现该功能的代码).(parameter to allow specified projects to be excluded from analysis (our thanks to Andrej Pohlmann for contributing the code to implement this).)
- 集成了Visual Lint的解决方案和项目文件解析器以及各种实用程序功能.(Integrated the solution and project file parsers from Visual Lint, along with various utility functions.)
- 纠正了XSL样式表加载中潜在的缓冲区溢出(感谢Mark Ridgwell识别了此问题).(Corrected a potential buffer overflow in the loading of XSL stylesheets (thanks to Mark Ridgwell for identifying this).)
- 纠正了Visual C ++项目中中间文件文件夹的解析错误.(Corrected a bug in the parsing of intermediate file folders within Visual C++ projects.)
- 恢复了失踪人员(Reinstated a missing)**-u(-u)**分析命令行中的选项.(option in the analysis command line.)
- 已将应用程序版本添加到生成的报告中.(Added the application version to generated reports.)
- 修复了潜在的COM异常(Fixed a potential COM exception in)
Utils::RefreshAllOpenBrowserWindows()
.(.) - 修复了小绒毛问题.(Fixed minor Lint issues.)
- 现在,该代码已在(The code is now released under the) 代码项目开放许可(CPOL)(Code Project Open Licence (CPOL)) v1.0;文件标语已相应更新.(v1.0; file banners have been updated accordingly.)
版本1.3.1.7(2007年6月)(Version 1.3.1.7 (June, 2007))
- 添加了(Added the)**/配置文件(/configfile)**切换到允许名称(switch to allow the name of the)**标准(std.lnt)**要指定的文件.(file to be specified.)
- 公司客户要求修复和更正.(Incorporated customer requested fixes and corrections.)
- 开始删除MFC特定的代码.(Started removing MFC specific code.)
- 修复了大多数未解决的Lint问题.(Fixed most outstanding Lint issues.)
版本1.3.0.6(2006年3月)(Version 1.3.0.6 (March, 2006))
- 添加了对Visual Studio .NET解决方案配置的支持.现在可以直接指定解决方案配置,并为每个项目自动选择相应的配置.(Added support for Visual Studio .NET solution configurations. The solution configuration can now be specified directly, with the corresponding configuration for each project being selected automatically.)
- 添加了(Added the)**/cfg?(/cfg?)**参数以允许在解决方案或项目级别查询可用配置.(parameter to allow the available configurations to be queried at either solution or project level.)
CSolutionLintAnalyser
和(and)CProjectLintAnalyser
现在仅尝试刷新浏览器窗口,如果(now only attempt to refresh browser windows if the)**/秒(/s)**参数已指定.当实用程序作为服务运行时,这可以防止出现问题.(parameter is specified. This prevents problems when the utility is run as a service.)
版本1.2.4(2005年3月)(Version 1.2.4 (March 2005))
CSolutionLintAnalyser::Analyse()
和(and)CProjectLintAnalyser::Analyse()
现在使用(now use)SHCreateDirectoryEx()
代替(instead of)mkdir()
创建用于分析结果的文件夹,以便自动创建递归文件夹.(to create folders for analysis results so that recursive folders are automatically created.)注意:此功能需要Windows 2000或更高版本(Note: this function requires Windows 2000 or later).(.)- 修复了LintProject CodeProject论坛上建议的UNC路径检查.(Fix to UNC path checking suggested on the LintProject CodeProject forum.)
- 改进了相对路径名的处理.分析文件和源文件不再需要驻留在同一逻辑驱动器上.(Improved handling of relative pathnames. Analysis and source files no longer need to reside on the same logical drive.)
- 添加了对直接将参数传递到的支持(Added support for passing parameters directly to)lint-nt.exe(lint-nt.exe)通过新的命令行选项((via a new command line option ()/l" <参数>"(/l"")).().)
- 如果从255返回警告计数(If a warning count of 255 is returned from)lint-nt.exe(lint-nt.exe),(,)
CFileLintAnalyser::Analyse()
现在将解析结果文件以尝试检索真实的警告计数.(will now parse the results file to try to retrieve the true warning count.) - 重新实施(Re-implemented the)
FileExists()
辅助功能.(helper function.) - 为源代码控制添加了解决方案.(Added solution to source code control.)
- 进行修改以允许在包含空格的路径名中安装PC-Lint的系统上进行操作(例如,(Modifications to allow operation on systems where PC-Lint is installed in a pathname containing spaces (e.g.,)C:\ Program Files \ Lint(C:\Program Files\Lint)).().)
版本1.2.2(2004年10月)(Version 1.2.2 (October, 2004))
LintProject版本1.2.2已发布到CodeProject.(LintProject version 1.2.2 released to CodeProject.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ XML VC7.1 WinXP Windows Win2K Visual-Studio MFC VS.NET2003 Dev 新闻 翻译