patch: add -Wno-overlength-strings

Zack Weinberg zackw@panix.com
Fri Jan 27 15:30:00 GMT 2006


On Fri, Jan 27, 2006 at 08:18:22AM -0600, Gabriel Dos Reis wrote:
> Zack Weinberg <zackw@panix.com> writes:
> | Bernd pre-approved this patch, but I'd like another pair of eyes
> | on some bits: my wording in the manual, and the justification for
> | not issuing this warning in C++.
> 
> C++, unlike C, imposes no standard minimum limits.

There's Annex B.  Which is not normative, which is the rationale I used.
The question is what would be maximally useful to C++ programmers - my
feeling is that it's best not to issue the warning at all, but maybe
I'm wrong, I'm not much of a C++ guru.

> [...]
> 
> | ==================================================================
> | --- c-opts.c	(revision 110316)
> | +++ c-opts.c	(local)
> | @@ -893,6 +893,8 @@ c_common_handle_option (size_t scode, co
> |        cpp_opts->warn_endif_labels = 1;
> |        if (warn_pointer_sign == -1)
> |  	warn_pointer_sign = 1;
> | +      if (warn_overlength_strings == -1)
> 
> should not this be
> 
>     if (warn_overlength_strings == -1 && !c_dialect_cxx())

It's unconditionally set to zero in c_common_post_options if
c_dialect_cxx() is true.

zw



More information about the Gcc-patches mailing list