This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warnings about rcs_id strings: let's settle this
> > For what it's worth, I agree that some variant of Kean's patch should
> > be included. I think some of the concerns raised in the discussion of
> > the patch (enable at -Wextra? only for const variables?) should be
> > addressed, but hopefully we can do that in short order without
> > sidetracking again.
On Fri, May 02, 2003 at 11:14:36AM -0700, Kean Johnston wrote:
> I too agree. I've read the whole thread, and had some other discussions
> about the patch, and here's what I'm about to change it to do. I'd like
> a nod from Joe, Gaby and you Zack, at the very least before I go
> charging
> off into vim-land again.
>
> 1) -Wall will NOT turn on -Wunused-static-variable
Agreed.
> 2) -Wextra WILL turn on -Wunused-static-variable
Agreed.
> 3) -Wunused-static-variable disappears out of c-opts.c and stays only
> in flags.h and toplev.c
I have no opinion on that one.
> And now, for the hard decision ... do I make the code check for const
> variables only? I vote not, if for no other reason than the original
> construct that spawned this thread was almost always written as
> static char *sccsid = "blah";.
I strongly vote "not".
> By the way, why does THAT not emit a
> warning? You are assigning a const char * to a char *, thereby
> potentially losing the const-ness of it.
It's historical; originally string literals were type char[]. They
are changed to const char[] but as a special case, conversion to
char* is supposed to be allowed. It's a wart, I agree.