toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Toon-members] Weird signed overflow warning


From: Pekka Paalanen
Subject: Re: [Toon-members] Weird signed overflow warning
Date: Thu, 24 Jun 2010 10:35:36 +0300

On Wed, 23 Jun 2010 16:28:36 +0100 (BST)
"E. Rosten" <address@hidden> wrote:

> On Tue, 1 Jun 2010, Pekka Paalanen wrote:
> 
> > Hi,
> >
> > my code produces a weird warning in TooN. The attached source file
> > is a minimal example triggering the warning:
> >
> > $ bash gcc-warnings2.cc
> >
> > + g++ -O2 -Wall -Wextra -I.. -llapack gcc-warnings2.cc -o
> > gcc-warnings2
> 
> OK, this is a bit of a weird one, and I can't see any way to suppress
> the warning by changing the code. Essentially, it is warning that
> code written with broken assumptions about C++ may break. However, we
> aren't using broken assumptions.
> 
> C++ can only do compile-time size checks on static matrices, so TooN
> uses run-time checks for dynamically sized matrices. However, gcc has
> deduced that it can really determine the size of your matrices at
> compile time. This allows it to optimize away the size checks because
> it determines the test is always false. This is good, by the way.

So, another gcc quirk. Excellent, thanks.

If there was a gcc-specific #pragma to silence this warning, would you
take a patch with it #if'ed for gcc, or is that just useless code
clutter? If you would accept it, which file should I put it in?

I'm leaving for summer vacation, so I'll get back in August.


Cheers.

-- 
Pekka Paalanen, M.Sc. (Eng.)   LUT/IT, room 6505
doctoral student               http://www.it.lut.fi/project/rtmosaic/
address@hidden          http://www.iki.fi/pq/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]