[Bug c/31238] New: Too many instructions in C loop

2007-03-17 Thread sigra at home dot se
p Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sigra at home dot se http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31238

[Bug c++/30521] New: "if (i == n) ++i;" or "i += i == n;"?

2007-01-20 Thread sigra at home dot se
Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sigra at home dot se http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30521

[Bug other/29768] New: Implement -Werror for each kind of warning

2006-11-08 Thread sigra at home dot se
Severity: enhancement Priority: P3 Component: other AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sigra at home dot se http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29768

[Bug c++/29208] C++: Warn about unchecked use of pointers

2006-09-24 Thread sigra at home dot se
--- Comment #4 from sigra at home dot se 2006-09-24 23:57 --- (In reply to comment #3) > some functions require non zero pointers and those should crash instead of > having null pointer checks on them. And using references is not always the > answer as some functions need to b

[Bug c++/29208] C++: Warn about unchecked use of pointers

2006-09-24 Thread sigra at home dot se
--- Comment #2 from sigra at home dot se 2006-09-24 23:29 --- Sorry, accidentally hit commit too early. Try again: There should be a warning about unchecked use of pointers in C++. For example: void f(T * const x) { x->something... // x might be 0, warn. } void f(T * cons

[Bug c++/29208] New: C++: Warn about unchecked use of pointers

2006-09-24 Thread sigra at home dot se
Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sigra at home dot se http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29208

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-05-13 Thread sigra at home dot se
--- Comment #20 from sigra at home dot se 2006-05-13 08:44 --- I see that the feature I asked for has been implemented in the Ada frontend of GCC. This program: with Ada.Text_IO; use Ada.Text_IO; procedure Prov is A : Natural := 0; begin Put_Line ("A =" & A&

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #17 from sigra at home dot se 2006-01-18 23:23 --- There is some good advice at http://www.gotw.ca/publications/advice98.htm which says that one should be const-correct and use const whenever possible. (But I do not suggest using const for return values.) This feature

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #14 from sigra at home dot se 2006-01-18 20:49 --- > Isn't this a task for lint-like tool? GCC isn't such thing. Are you sure? http://directory.fsf.org/GNU/gcc.html says: "GCC provides many levels of source code error checking traditionally provided by ot

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #13 from sigra at home dot se 2006-01-18 20:41 --- > It does not make any sense to require the compiler to give a warning > in that case. Read the subject again: "optional" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25845

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #8 from sigra at home dot se 2006-01-18 19:29 --- > On Jan 18, 2006, at 11:19 AM, pcarlini at suse dot de wrote: > > > --- Comment #4 from pcarlini at suse dot de 2006-01-18 16:19 > > --- > > (In reply to comment #3) > >> const do

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #5 from sigra at home dot se 2006-01-18 16:25 --- (In reply to comment #3) > I still don't understand what this warning is useful for? > > const does nothing when it comes to local variables except for not letting > you touch it in other expressions. It

[Bug c++/25845] want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
--- Comment #2 from sigra at home dot se 2006-01-18 16:07 --- Example 1: { int i = f(); do_something(i + 1, 7, 'h'); do_something_else(i % 3, 'e'); } If i could be declared "const int", the compiler should warn. Example 2: float dra(float m, Pan

[Bug c++/25845] New: want optional warning for non-constant declarations that could be constant

2006-01-18 Thread sigra at home dot se
++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sigra at home dot se http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25845