• 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: 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

  • Follow-Ups:
    • Re: Suppress Clang Warning
      • From: Keary Suska <email@hidden>
References: 
 >Suppress Clang Warning (From: Keary Suska <email@hidden>)

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