This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -Wno-deprecated flag not working?
- From: Alexey Salmin <alexey dot salmin at gmail dot com>
- To: Peter Rockett <p dot rockett at sheffield dot ac dot uk>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Nov 2009 11:48:05 +0600
- Subject: Re: -Wno-deprecated flag not working?
- References: <1257977066.15317.12.camel@Mendelsohnn>
That's strange. According to documentation (as far as I get it) this
warning is enabled by option '-Wwrite-strings' which is not even
included in -Wall.
On Thu, Nov 12, 2009 at 4:04 AM, Peter Rockett
<p.rockett@sheffield.ac.uk> wrote:
> I am trying to compile the simple program:
>
>
> int main()
> {
> ? ? ? ?char* x[] = {"hello", "my", "boy"};
> ? ? ? ?return 0;
> }
>
> and I get a warning: deprecated conversion from string constant to
> ‘char*’. (OK - I expect that.) But when I add the -Wno-deprecated flag
> to the command line I still get the warning. The -Wno-deprecated flag
> does not seem to be suppressing the warning.
>
> Even odder, the latest MinGW port (version 4.4.0) doesn't report any
> warning, even without the compiler flag!
>
> Am I missing something?
>
> (Actually, I am trying to compile something with loads of embedded XPM
> files which graphics programs produce in the style above. I don't want
> to edit any of these, just suppress the ~1000 compilation warnings I'm
> getting.)
>
> BTW: Ubuntu 9.10 and gcc 4.4.2
>
> Peter
>
>