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: Jeffrey Walton <email@hidden>
- Date: Mon, 04 Feb 2013 17:47:22 -0500
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?
Jeff
_______________________________________________
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