

> particular type of constructs - note that constants are involved. > of "hey, you can silence it with with sledge-hammer" is the solution to this > You made an inference in an earlier message, and I would like to > | Is having an option to disable the warning the right fix for this PR or is it

> | > | down to having an option to disable the warning, doesn't it? > | > | We don't emit a warning when instantiated as a signed char, so everything > Subject: Re: unsigned warning in template This not just for template arguments, but of such comparaison The particularity of suchĮxpressions is that they are constants. Please, don't sorry about the terminology. | types which came from a template instantiation (sorry, I don't know | One idea would be to disable the warning if the expression involves That wouldīe a first order approximation of a solution to this issue. It that case, the compiler should just elide the warning. The particularity of this PR is that it involves only constants.
Bugzilla templates code#
| would let through code that you would prefer not to let through. | the warning is appropriate, and disabling the warning | A flag to control the warning does not provide Subject: Re: unsigned warning in template Here is a better example:ĪssertWarning.cpp: In function `void f(Int) [with Int = unsigned char, Int D =ĪssertWarning.cpp:7: instantiated from hereĪssertWarning.cpp:4: warning: comparison is always true due to limited range ofĪ.out: AssertWarning.cpp:4: void f(Int) : Assertion `0 <= x and x <= D' failed. I see, I oversimplified the problem a bit. > - Additional Comments From pinskia at gcc dot gnu dot org 16:10. > pinskia at gcc dot gnu dot org changed: Subject: Re: Wrong warning regarding assert > You reported the bug, or are watching the reporter. > - You are receiving this mail because:. Thing to be able to switch off all "triviality warnings". Perhaps for generic programming it would be a good I checked again the documentation of gcc/g++, but I couldn't find anything

But intuitively this seems tooīold to me. So perhaps the solution is to inhibit all warnings. Generic programming, where all those trivial situations (which triggers a warning) My general observation is, that the warning system of g++ doesn't fit well with We get a warning message (as I said, the typical monsters, pages and pages for In general is necessary (for signed cases), but for all unsigned cases I see but the problem is that with generic code, where function f in fact isĪ function template, the warning becomes a bad thing: The assertion c>=0 > c>=0 is always true for unsigned characters, thats where the warning comes > - Additional Comments From marcus at jet dot franken dot de 14:36. > tests=AWL,BAYES_30,IN_REP_TO,REFERENCES,USER_IN_WHITELIST > X-SA-Exim-Mail-From: Subject: Wrong warning regarding assert > From: "marcus at jet dot franken dot de" On Fri, at 02:36:08PM -0000, marcus at jet dot franken dot de wrote: Since it doesn't seem to be possible to inhibit this warning message (!), To the deeply nested template names), the output of g++ is rendered Place, and since the warning messages typically are *very* long (due I'm writing a generic library, and this warning shows up all over the Tested Versions: 3.3 and 3.2.1 (same behaviour). Which is wrong: Running it yields (as it should be):Ī.out: AssertWarning.cpp:3: void f(unsigned char): Assertion `0 <= c and c <= $ctype - Content type, see Bugzilla::Constants::: In function `void f(unsigned char)':ĪssertWarning.cpp:3: warning: comparison is always true due to limited range table or graph), specify the one to choose. $format - When the template exists under several formats Params: $file - Name of the template to display. Returns: nothing METHODS get_format($file, $format, $ctype) Description: Construct a format object from URL parameters. Params: $output - true if you want the function to print out information about what it's doing. SUBROUTINES precompile_templates($output)ĭescription: Compiles all of Bugzilla's templates in every language. It should not be used directly by scripts or modules - instead, use Bugzilla->instance->template to get an already created module. This is basically a wrapper so that the correct arguments get passed into the Template constructor. Scalar($cgi->param('ctype'))) DESCRIPTION My $format = $template->get_format("foo/bar", Bugzilla::Template - Wrapper around the Template Toolkit Template object SYNOPSIS my $template = Bugzilla::Template->create
