How to increase error limit in Visual Studio?

六月ゝ 毕业季﹏ 提交于 2019-12-17 20:16:19

问题


When building an app. VS will complain of exceeded error count:

fatal error C1003: error count exceeds 100; stopping compilation

Is there a way to increase the limit?

Thanks in advance,
- Oleksii Skidan


回答1:


This limitation is hardcoded. Here is the post from the MSFT employee in the microsoft.public.vsnet.general group dated 2006 (look for 'Fatal Error C1003'):

Hi,

Unfortunately this 100 limitation is hard coded and cannot be changed. It's just inpractical to keep all errors information around since one error may cause other several errors.

I hope you understand the rational behind this design by our product team. However, if you still have concerns about this, please feel free to submit your feedback at
http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220 which is monitored by our product team. Thank you for your understanding.

Sincerely, Walter Wang (waw...@online.microsoft.com, remove 'online.') Microsoft Online Community Support"




回答2:


I don't think so. VS basically reports all errors it encounters during compilations. There might be some erroneous parts of the code that make the compiler getting caught in an infinite "error" loop.

The limit was implemented to avoid that. In most cases the 100 errors you get are just the same error reported over and over again. What would be the sense in increasing the number of repetitions?

Maybe you can post the code snippet where the error occurs first, so we can help you fix it.




回答3:


I believe that it is a hard-coded limit, so no.

As others have commented, it's difficult to understand what you want to achieve by this.

At the end of the day, you'll have to fix them all, so get stuck in and start fixing them. Eventually, you'll get below 100, and you can start counting them.

It is not normally valuable to report the actual number of errors when this occurs. Most of the time, when you get C1003, it's actually only a few real errors, leading to a massive chain of other errors.

(e.g.)

  • If there is an error in a .h file, that error will be reported in every .cpp file that #includes it.
  • If there is an error that prevents any kind of identifier being defined (e.g. a class, variable, method name), then every time you try to use it later on, an error will be reported.



回答4:


Workaround to reduce number of reported errors:

  • rename cl.exe to cl-orig.exe
  • roll your own cl.exe that launches cl-orig.exe, capturing its stdout / stderr
  • parse stderr, looking for error messages and counting them
  • breaks after first n errors

See http://msdn.microsoft.com/en-us/library/ms682499(v=vs.85).aspx for some hints.




回答5:


I also have a project like this: sometimes Visual Studio decides there is a lot to do, emits 100 really irrelevant messages about other parts of the solution and aborts the build because it reached the message limit without working on the project I'm interested on.

The workaround we have found is to use msbuild to build the solution from a command prompt: the Use MSBuild walkthrough outlines the steps. msbuild outputs all messages to the console and once the build completes we can work and debug again in Visual Studio. Not ideal, but it lets us complete the task at hand.



来源:https://stackoverflow.com/questions/2880936/how-to-increase-error-limit-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!