Well, I'll carefully review my patch and post is to the tracker. Dag, I'll try to make clear the spirit of this patch. Supose some Cython test case like this:
cdef void foo(): int var1, var2 var1 = var2 Then GCC will emit TWO anoying warnings: 1) 'foo' is never used 2) 'var2' was used uninitialized. Then my patch will fix test cases like the above as follow: cdef void foo(): int var1, var2=0 var1 = var2 foo() Note that I'm just initializing 'var2' and using 'foo'. Do you see any drawback about that? On Thu, Oct 16, 2008 at 2:37 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > On Oct 16, 2008, at 9:47 AM, Dag Sverre Seljebotn wrote: > >> I am very against doing anything with the testcases - the fact that >> they trigger gcc warnings is a *good* thing. >> >> The ultimate goal of any test suite is full test coverage. If >> Cython is capable of producing gcc warnings, but the test suite >> does not, then that means that some code branches/some cases are >> never exercised, and hence a reduction in test coverage. >> >> Of course, given resources, the warnings should be eliminated, and >> where that cannot be done, they should be verified as expected >> warnings and silenced. But that comes down to priorities... >> >> At least my opinion is that ideally Cython should not produce C >> warnings if it can help it, instead any warnings should be emitted >> in Cython, for improved usability. >> >> For instance with the buffer testcase, I definitely want to test >> *only* declaration and not using it, as a seperate testcase. >> Currently this leads to generating unused variables. I consider >> this a bug, but a bug that has been rather low on my list of >> priorities, especially since they would be automatically fixed by >> some stuff I'm thinking about down the line. >> >> I refuse to call unused local variables a serious issue, compared >> to other stuff we could be improving. But, having the testcase >> there complaining is much better than pretending the problem >> doesn't exist though. > > I would rather have a trac tickets about this, and have much better > signal-to-noise ratio while running the doctest. If a change > introduces warnings (especially real one) then I'd rather be able to > see them loud and clear--right now I probably wouldn't notice. > >> (Disclaimer: I didn't actually read the patch as I am on my cell, >> answering to the contents of your post.) > > The patch turns unused local vars into used local vars. > > - Robert > >> >> Dag Sverre Seljebotn >> -----Original Message----- >> From: "Lisandro Dalcin" <[EMAIL PROTECTED]> >> Date: Thursday, Oct 16, 2008 5:36 pm >> Subject: [Cython] removing GCC warnings for test suite, please >> review [part1] >> To: cython-dev <[email protected]>Reply-To: cython- >> [EMAIL PROTECTED] >> >> How often do you scan the full output of 'python runtests.py' in order >>> to look for suspicious C-code generation? I guess never ;-), as >>> Cython >>> test suite generate many warning with GCC. >>> >>> As this situation make me feel very uncomfortable, you have here for >>> review a patch touching many test cases for removing those nasty GCC >>> warnings. If there are no major objections, I would like to push this >>> ASAP. >>> >>> -- >>> Lisandro Dalcín >>> --------------- >>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) >>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) >>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) >>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina >>> Tel/Fax: +54-(0)342-451.1594 >>> >> >> _______________________________________________ >> Cython-dev mailing list >> [email protected] >> http://codespeak.net/mailman/listinfo/cython-dev > > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
