• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suppress Clang Warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suppress Clang Warning


  • Subject: Re: Suppress Clang Warning
  • From: Keary Suska <email@hidden>
  • Date: Sun, 28 Feb 2010 11:57:49 -0700

On Feb 28, 2010, at 11:34 AM, Ken Thomases wrote:

> 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.

D'oh! That was it. I wasn't calling va_start before using argumentList.

Thanks,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

 _______________________________________________
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

References: 
 >Suppress Clang Warning (From: Keary Suska <email@hidden>)
 >Re: Suppress Clang Warning (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Suppress Clang Warning
  • Previous by thread: Re: Suppress Clang Warning
  • Index(es):
    • Date
    • Thread