注解C / C ++ code [英] Annotating C/C++ code

查看:176
本文介绍了注解C / C ++ code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我得到了微软的标准标注语言(SAL)以注释C / C ++源$ C ​​$ CS。此功能可以是非常有益的调试和开发过程中但不幸的是它不是一个便携式的跨平台库。是否有标注C / C ++ codeS任何标准或开放源码工具?是否有类似的功能在 GCC

Recently I got a grasp of Microsoft's Standard Annotation Language (SAL) for annotating C/C++ source codes. This feature can be very helpful for debugging and during development but unfortunately it is not a portable cross-platform library. Is there any standard or open-source tool for annotating C/C++ codes? Is there a similar feature available in gcc?

推荐答案

这是我所知道的最接近是的 GCC的属性的,但其他的编译器不支持的语法。 GCC属性语法不支持尽可能多的注释作为SAL,但你可能会发现一些注释是有益的。

The closest that I'm aware is GCC's attributes, but other compilers don't support the syntax. GCC attribute syntax does not support as many annotations as SAL, but you may find some of the annotations useful.

另外,如果你使用模板,你可能想看看提升静态断言,其中大多数编译器的支持。

Alternatively, if you're using templates, you may want to check out Boost Static Assert, which most compilers support.

另外请注意, CLANG支持除了GCC 的多个注释,并且使用CLANG的静态分析器可能更接近你'重新想。

Also note that CLANG supports more annotations than GCC, and using CLANG's static analyzer may be closer to what you're wanting.

这篇关于注解C / C ++ code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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