• 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
Make "incompatible pointer type" an error, not a warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make "incompatible pointer type" an error, not a warning


  • Subject: Make "incompatible pointer type" an error, not a warning
  • From: Scott Johnson <email@hidden>
  • Date: Mon, 09 Feb 2009 09:20:49 -0800
  • Thread-topic: Make "incompatible pointer type" an error, not a warning

I get a warning in Xcode 3.0 in my C Carbon app which is "warning:
initialization from incompatible pointer type". This warning can be dealt
properly by casting the pointer. This is all great, but I would actually
prefer this warning be an error, so that I am required to cast the pointer
assignment, and I do not want to open up a whole series of other warnings
and errors in the process.

That is, I am not prepared to make all warnings into errors, nor do I want
to turn on a flag that will throw other errors or warnings at me as well. So
is there a flag that will simply cause "initialization from incompatible
pointer type" to be an error and not a warning?

For reference, here is a snippet of code that produces this warning:

typedef struct a {
    char c;
} a;

typedef struct b {
    char c;
} b;

int main(int argc, char* argv[])
{
    a *x;
    b *y = x;

    return 0;
}

NOTE: changing the last line before the return to "b *y = (b*)x;" will get
rid of this warning, and I want the compiler to force me to do this with an
error, rather than recommend it with a warning.

Thanks,
Scott Johnson

 _______________________________________________
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: Make "incompatible pointer type" an error, not a warning
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Re: Booleans not being set
  • Next by Date: Making a bundle from an existing target
  • Previous by thread: Re: Application Verification Failed Problem
  • Next by thread: Re: Make "incompatible pointer type" an error, not a warning
  • Index(es):
    • Date
    • Thread