由GCC建议的候选人 [英] Supress candidates suggested by GCC

查看:121
本文介绍了由GCC建议的候选人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是gcc 4.7.2。我的代码在模板和增强用法上相当沉重。当我编译并且定义或使用了某些模糊的东西时,我经常会收到错误消息,提示二十几个候选人,通常在他们单独的包含在某个深度路径中的文件中定义:,每个候选人都有相应的错误消息,该特定候选人失败。特别是使用boost和模板,即使这样的单个错误也变得完全无法理解。



我的问题:


是否有选项可以控制搜索的深度为合适的候选人去?


理想情况下,我希望它将它关闭,或者至少将其缩小到只有第一个或两名候选人 - 其余的候选人无论如何都是无用的。

解决方案

我使用 gccfilter 使模板错误更具可读性。从网站:


特点:


  • 诊断消息的着色(可自定义的颜色),
  • 简化模板化程序输出:删除with子句,模板参数,
  • 行内置换
  • 删除名称空间,
  • 删除实例化链。



I'm using gcc 4.7.2. My code is rather heavy on template and boost usage. When I compile and I've defined or used something ambiguous, I often get error messages that suggest two dozen candidates, usually defined in their separate "in file included from [some deep path]:", with corresponding error messages per candidate on why that particular candidate fails. Especially using boost and templates, even a single error like this becomes completely unintelligible.

My question:

Is there an option to control how deep the search for suitable candidates goes?

Ideally, I'd like it turned off, or at least reduce it to only the first one or two candidates -- the rest of the candidates is usually pretty useless anyway.

解决方案

I use gccfilter to make template errors much more readable. From the website:

Features:

  • coloring of diagnostic messages (with customizable colors),
  • simplification of templated programs output: removal of "with" clauses, template arguments,
  • inline replacement of template arguments by their values,
  • removal of namespaces,
  • removal of instantiation chains.

这篇关于由GCC建议的候选人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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