• 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: const assignment issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: const assignment issue


  • Subject: Re: const assignment issue
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 8 Dec 2006 22:35:21 -0800

On Dec 8, 2006, at 10:58 AM, Luigi Castelli wrote:

Exactly, I get the same thing.
If I make the file into a .cp then X-code reports no
error.
That's weird, isn' it? Or am I missing something
obvious?

Are C and C++ behaving differently in regards to
consts ?

I believe this is the obvious thing you're missing: C++ is different language than C. In particular, C++ is not a strict superset of C; its type system is a lot stricter than C's, and it has a number of additional behaviors and enhancements such as initialization of one const variable from either an inline constant or another const variable.


Is there any way that it could be told X-code not to
complain even if the declaration is made in a .c file
?

The compiler -- GCC -- generates the warnings, not Xcode. There are a wide variety of GCC warning flags that can be turned on via Xcode's build settings, along with documentation about them. There are also several different C dialects available via GCC; read the GCC documentation on some of these dialects to see if they may be a better match for your project. Note, though, that you may be trading some amount of portability for convenience if you do this.


  -- Chris

_______________________________________________
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: 
 >Re: const assignment issue (From: Luigi Castelli <email@hidden>)

  • Prev by Date: Xcode picking up wrong header files
  • Next by Date: Re: Xcode picking up wrong header files
  • Previous by thread: Re: Re: const assignment issue
  • Next by thread: Re: const assignment issue
  • Index(es):
    • Date
    • Thread