This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc warning


> From: Joe Buck <jbuck@racerx.synopsys.com>
> To: aoliva@redhat.com (Alexandre Oliva)
> Date: Tue, 31 Oct 2000 10:57:15 -0800 (PST)
> Cc: jching@flex.com (Jimen Ching), gcc@gcc.gnu.org

> On Oct 31, 2000, Jimen Ching <jching@flex.com> wrote:
> > 
> > > I got this warning with latest CVS.  How do I fix my code so it does not
> > > appear?

> Alexandre Oliva writes:
> > Use shorter literal strings.

> Right, but this begs the question of when this warning should be enabled:
> by default, with -Wall, etc.

> A user trying to check her program for maximum portability will
> supply flags like -ansi -pedantic; in that case the warning should
> be produced.  But I'm not sure that it should be produced by default
> or even with -Wall.

The C standard in time should go the way of the C++ standard.  The C++
standard specifies outrageously large minimums, just to force people
to not fix them artificially low.  Warnings that a program is larger
than a minimum isn't all that useful anymore if most all C/C++
compilers don't have a limit for that quantity.  For example, warning
about needing more than 6 characters in an external identifier isn't
useful, as no such systems exist anymore.

I say we banish the warning.  I think they should only come on when
asked for, and that -Wall not turn them on.

[ minute pause to check C standard ]

Actually, the C9X standard I think reworded the minimums to the same
in spirit to the C++ Standard.  I think we should migrate to the
default language being C99, not C89 and then the warning just goes
away.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]