r180673 - Silence a silly sign compare warning from GCC.
Benjamin Kramer
benny.kra at gmail.com
Sun Apr 28 11:31:16 PDT 2013
On 28.04.2013, at 16:54, David Blaikie <dblaikie at gmail.com> wrote:
>
> On Apr 28, 2013 1:09 AM, "Benjamin Kramer" <benny.kra at googlemail.com> wrote:
> >
> > Author: d0k
> > Date: Sat Apr 27 10:07:53 2013
> > New Revision: 180673
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=180673&view=rev
> > Log:
> > Silence a silly sign compare warning from GCC.
>
> What's the warning? That you shouldn't used a signed value for an array size?
>
> Should we just disable the warning then?
The warning was for the loop below, which compares unsigned i != NumLocs. IMHO equality sign compare warnings are useless. I only saw this on the debian buildbot though, so it's possible that the warning is fixed in newer releases of GCC.
- Ben
>
> >
> > Modified:
> > cfe/trunk/lib/Sema/DeclSpec.cpp
> >
> > Modified: cfe/trunk/lib/Sema/DeclSpec.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/DeclSpec.cpp?rev=180673&r1=180672&r2=180673&view=diff
> > ==============================================================================
> > --- cfe/trunk/lib/Sema/DeclSpec.cpp (original)
> > +++ cfe/trunk/lib/Sema/DeclSpec.cpp Sat Apr 27 10:07:53 2013
> > @@ -847,7 +847,7 @@ void DeclSpec::Finish(DiagnosticsEngine
> > TypeSpecSign != TSS_unspecified ||
> > TypeAltiVecVector || TypeAltiVecPixel || TypeAltiVecBool ||
> > TypeQualifiers)) {
> > - const int NumLocs = 8;
> > + const unsigned NumLocs = 8;
> > SourceLocation ExtraLocs[NumLocs] = {
> > TSWLoc, TSCLoc, TSSLoc, AltiVecLoc,
> > TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list