Re: Suppress Clang Warning
Re: Suppress Clang Warning
- Subject: Re: Suppress Clang Warning
- From: Ken Thomases <email@hidden>
- Date: Sun, 28 Feb 2010 12:34:26 -0600
On Feb 28, 2010, at 11:41 AM, Keary Suska wrote:
> Is there any way to suppress clang warnings, in particular: I have several methods that take and pass a va_list to another method. Clang complains, "Pass-by-value argument in message expression is undefined".
>
> Example code in method:
>
> va_list argumentList;
>
> NSString *description = [[NSString alloc] initWithFormat:message arguments:argumentList];
>
> Or am I missing something here?
If that code snippet is really representative, then you're missing something. The value of argumentList is uninitialized, which is what the warning is complaining about. You need to use the va_start function to initialize it based on the variable argument list of the function. Or, you could use va_copy to copy it from another (properly-initialized) va_list.
Can you post an entire, real-world method or function that's giving the warning?
Regards,
Ken
_______________________________________________
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