• 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
Prevent warnings on forward struct declaration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prevent warnings on forward struct declaration


  • Subject: Prevent warnings on forward struct declaration
  • From: Trygve Inda <email@hidden>
  • Date: Sat, 26 Nov 2005 07:59:32 +0000
  • Thread-topic: Prevent warnings on forward struct declaration

typedef void (*SomeCompletionProcPtr) (struct SomeControlBlock *dInfo);

typedef struct SomeControlBlock
{
  CFURLRef                mURLRef;
  CFReadStreamRef         mReadStreamRef;
  EventLoopTimerRef       mNetworkTimeoutTimerRef;
  --- more stuff here ---

  SomeCompletionProcPtr    mCompletion;
}
SomeControlBlock, *SomeControlBlock;

So I have a struct and one of its variables is a pointer to a function whose
parameter is a pointer to the struct.

The forward declaration (with "struct" in the param list) works, but Xcode
generates a warning:

warning: its scope is only this definition or declaration, which is probably
not what you want

warning: 'struct SomeControlBlock' declared inside parameter list


I can't see a way to turn these off in the build settings (Target Info).

Any ideas? In CW no warning was given (or maybe I have long since forgotten
how I turned it off there).

Thanks,

Trygve


 _______________________________________________
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: Prevent warnings on forward struct declaration
      • From: David Fang <email@hidden>
  • Prev by Date: Re: Target setup for unit testing (using cppunit)
  • Next by Date: Re: Prevent warnings on forward struct declaration
  • Previous by thread: Re: Using newer version of gcc for shared libraries
  • Next by thread: Re: Prevent warnings on forward struct declaration
  • Index(es):
    • Date
    • Thread