Re: Apple LLVM 4.2 (part of Xcode 4.6) checks doxygen comments
Re: Apple LLVM 4.2 (part of Xcode 4.6) checks doxygen comments
- Subject: Re: Apple LLVM 4.2 (part of Xcode 4.6) checks doxygen comments
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 05 Feb 2013 00:24:45 +0100
Le 4 févr. 2013 à 23:47, Jeffrey Walton <email@hidden> a écrit :
> On Mon, Feb 4, 2013 at 5:39 PM, Jean-Daniel Dupas
> <email@hidden> wrote:
>>
>> Le 4 févr. 2013 à 21:10, Sean McBride <email@hidden> a écrit :
>>
>>> On Mon, 4 Feb 2013 11:16:22 -0800, Jens Alfke said:
>>>
>>>>
>>>> On Jan 29, 2013, at 1:29 PM, Marshall Clow <email@hidden> wrote:
>>>>
>>>>> If you are commenting your code with doxygen - style comments, (and
>>>> using Xcode 4.6) you should consider adding '-Wdocumentation" to your
>>>> compiler options.
>>>>> When this is enabled, clang will check your doxygen comments and make
>>>> sure that they match the code that they refer to.
>>>>
>>>> This is nice (and it caught several glitches in my doc-comments), but it
>>>> will cause the target to fail to compile in Xcode 4.5 or earlier. I had
>>>> thought Clang would just ignore an unknown warning flag, but no, it’s a
>>>> fatal compile error. :(
>>>>
>>>> I had to back out this change in my project, as I don’t want to break
>>>> Xcode 4.5 compatibility just for the sake of doc-comment checking.
>>>
>>> I had a similar problem. I wanted to suppress some -Wdocumentation warnings from 3rd party headers I include, so wrapped my #include in:
>>>
>>> #pragma clang diagnostic ignored "-Wdocumentation"
>>>
>>> But alas that statement also results in a warning with older clangs. :(
>>
>> It can be done conditionally:
>>
>> #if __has_warning("-Wdocumentation")
>> # define disable_doc_warning _Pragma("clang diagnostic ignored \"-Wdocumentation\"")
>> #else
>> # define disable_doc_warning
>> #endif
>>
>> And then, you can use this macro to disable warning when needed.
> That's very nice.
>
> I'm picking up to much spurious noise when searching for
> "__has_warning". Is it Apple? LLVM? When did it become available?
This is clang (aka LLVM in Xcode) and it exists for some times now (I think the first Xcode LLVM release already supported it).
clang also support __has_include, __has_include_next, to check if a header is available, __has_builtin to check if a builtin function is supported, and __has_feature to check for special language feature (c++11 and C11 extensions especially, but it is also used to check if things like ObjC ARC or if C++ exceptions and RTTI are enabled).
The full list of flags and supported values is available here: http://clang.llvm.org/docs/LanguageExtensions.html
Note that the llvm.org site is actually down for maintenance, so if it does not work right now, try again later.
> Jeff
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden