2011/1/28 Robert Bradshaw <rober...@math.washington.edu>: > On Fri, Jan 28, 2011 at 12:20 AM, Vitja Makarov <vitja.maka...@gmail.com> > wrote: >> 2011/1/28 Robert Bradshaw <rober...@math.washington.edu>: >>> On Thu, Jan 27, 2011 at 10:46 PM, Vitja Makarov <vitja.maka...@gmail.com> >>> wrote: >>>> 2011/1/28 Vitja Makarov <vitja.maka...@gmail.com>: >>>>> 2011/1/28 Stefan Behnel <stefan...@behnel.de>: >>>>>> Vitja Makarov, 28.01.2011 07:19: >>>>>>> 2011/1/27 Stefan Behnel: >>>>>>>> Vitja Makarov, 27.01.2011 11:19: >>>>>>>>> https://github.com/vitek/cython/blob/master/Cython/Compiler/ExprNodes.py#L4995 >>>>>>>>> >>>>>>>>> .... >>>>>>>>> def analyse_types(self, env): >>>>>>>>> if not self.label_num: >>>>>>>>> error(self.pos, "'yield' not supported here") >>>>>>>>> .... >>>>>>>>> >>>>>>>>> This error message should be replaced with assertion on self.label_num >>>>>>>>> or internal error. >>>>>>>> >>>>>>>> Yes, if handled by the transform already. >>>>>>>> >>>>>>> >>>>>>> I tried to handle IfStatNode terminator here: >>>>>>> >>>>>>> https://github.com/vitek/cython/commits/uninitialized >>>>>>> >>>>>> >>>>>> >>>>>>> About tests I the easiest way is to add compiler directive -Werror >>>>>> >>>>>> We already have an "errors are fatal" option, but I like this one. >>>>>> >>>>> >>>>> This one means treat warnings as errors. >>>>> >>>>>> >>>>>>> And add it in cython header comment >>>>>>> >>>>>>> # cython: werror=True >>>>>> >>>>>> Or rather "warnings_are_errors=True". >>>>> >>>>>> Cython/Options.py: >>>>>> 'warn': None, >>>>>> 'warn.undeclared': False, >>>>> >>>>> Or better warn.errors >>>>> >>>>> But I'm wondering how to get access to >>>>> env.directives >>>>> >>>>> inside Erros.warning >>>>> >>>> >>>> So maybe it would be better to have -Werror command line switch? >>> >>> Directives can be enabled from the command line, so I'd rather it be a >>> directive. +1 to warnings_are_errors over the more cryptic (for those >>> not familiar with gcc) werror. >>> >> >> Command line options are stored in Cython.Options, >> Compiler directives in environment is it accessible from Cython.Errors? > > That is a good point. No, Cython.Errors is "global" wheras directives > (may) have smaller scope. As it's not anything that influences the > behavior of the program itself, I'm less adamant that there be a way > to express it in the source code file. >
I've added support for --warning-errors and -Werror command line flags Also test runner now supports warnings. I found that warnings() sometimes could be called with no position, so this warning will still be warnings with -Werror flag. https://github.com/vitek/cython/commits/uninitialized -- vitja. _______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev