• 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
gcc4.0 and -Wcast-qual
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc4.0 and -Wcast-qual


  • Subject: gcc4.0 and -Wcast-qual
  • From: Dmitry Markman <email@hidden>
  • Date: Thu, 3 Nov 2005 20:09:33 -0500

Hi

consider the following code:

#include <iostream>

const char *foo() {
        return "test";
}

int main(int args, char **argv) {
        std::cout << (char *)foo() << "\n";
}

/usr/bin/gcc-3.3 -c main.cpp -Wcast-qual

returns 
main.cpp: In function `int main(int, char**)':
main.cpp:8: warning: cast from `const char*' to `char*' discards qualifiers
   from pointer target type


gcc  -c main.cpp -Wcast-qual
returns nothing,
why is that?

thanks

I'm talking about 10.4.3 and XCode 2.1 so default compiler is gcc 4.0.0





Dmitry Markman

Dmitry Markman


 _______________________________________________
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: gcc4.0 and -Wcast-qual
      • From: David Fang <email@hidden>
  • Prev by Date: Re: beginner question on using code revision history SCM and subversion
  • Next by Date: Re: "Flattening" a static library
  • Previous by thread: Re: beginner question on using code revision history SCM and subversion
  • Next by thread: Re: gcc4.0 and -Wcast-qual
  • Index(es):
    • Date
    • Thread