Re: Warning C vs C++

2005-09-24 Thread Kai Henningsen
[EMAIL PROTECTED] (Ben Elliston) wrote on 21.09.05 in <[EMAIL PROTECTED]>: > Per Abrahamsen wrote: > > > A -Weverything that turned on all boolean warnings would be nice. It > > would be useless alone, but nice followed by a lot of > > -Wno-somesillywarning -Wno-anothersillywarning arguments. >

Re: Warning C vs C++

2005-09-24 Thread Kai Henningsen
[EMAIL PROTECTED] (DJ Delorie) wrote on 21.09.05 in <[EMAIL PROTECTED]>: > > Incidentally, any time I've done this, I wanted labels on warnings > > as to what option was responsible > > -fdiagnostics-show-option ... as alluded to in the text immediately following the place yu snipped. MfG Kai

Re: Warning C vs C++

2005-09-24 Thread Marc Espie
In article <[EMAIL PROTECTED]> you write: >On Saturday 17 September 2005 17:45, you wrote: >> That's a real misunderstanding. There are many warnings that are very >> specialized, and if -Wall really turned on all warnings, it would be >> essentially useless. The idea behind -Wall is that it repres

Re: Warning C vs C++

2005-09-21 Thread DJ Delorie
> Incidentally, any time I've done this, I wanted labels on warnings > as to what option was responsible -fdiagnostics-show-option

Re: Warning C vs C++

2005-09-21 Thread Kai Henningsen
[EMAIL PROTECTED] (Per Abrahamsen) wrote on 19.09.05 in <[EMAIL PROTECTED]>: > Robert Dewar <[EMAIL PROTECTED]> writes: > > > Per Abrahamsen wrote: > > > >> The idea was that you would be sure to get all the (boolean) warnings > >> that are relevant for your project, and can give an explicit reas

Re: Warning C vs C++

2005-09-20 Thread Ben Elliston
Per Abrahamsen wrote: > A -Weverything that turned on all boolean warnings would be nice. It > would be useless alone, but nice followed by a lot of > -Wno-somesillywarning -Wno-anothersillywarning arguments. I agree. I acknowledge that it would be useless in the general sense (you couldn't us

Re: Warning C vs C++

2005-09-20 Thread Mark Mitchell
Tommy Vercetti wrote: > Fair enough. Still - thou - I would kindly request adding singness warning as > default in gcc. From security perspective, that's required. I would even > generate errors on those, if you ask me, but I know this isn't quite normal > for the rest of world. Frankly, I ag

Re: Warning C vs C++

2005-09-19 Thread Tommy Vercetti
On Monday 19 September 2005 01:10, Joe Buck wrote: > On Sun, Sep 18, 2005 at 06:54:26PM +0200, Florian Weimer wrote: > Generally speaking, we want -Wall to be safe to use. gcc has some > warnings that can't be silenced without making correct programs > worse (-Weffc++ comes to mind); these are not

Re: Warning C vs C++

2005-09-19 Thread Per Abrahamsen
Robert Dewar <[EMAIL PROTECTED]> writes: > Per Abrahamsen wrote: > >> The idea was that you would be sure to get all the (boolean) warnings >> that are relevant for your project, and can give an explicit reason >> for each warning you don't want. >> It would be particularly useful when upgrading G

Re: Warning C vs C++

2005-09-19 Thread Robert Dewar
Per Abrahamsen wrote: The idea was that you would be sure to get all the (boolean) warnings that are relevant for your project, and can give an explicit reason for each warning you don't want. It would be particularly useful when upgrading GCC, in order to be sure you get the benefit of any new

Re: Warning C vs C++

2005-09-19 Thread Per Abrahamsen
Joe Buck <[EMAIL PROTECTED]> writes: > In that sense, -Wall effectively means "all the warnings we recommend > that you use". Some people might want to argue with this, but that > is the practical effect. A -Weverything that turned on all boolean warnings would be nice. It would be useless alon

Re: Warning C vs C++

2005-09-18 Thread Joe Buck
On Sun, Sep 18, 2005 at 06:54:26PM +0200, Florian Weimer wrote: > * Tommy Vercetti: > > >> The warning is controlled by -Wsign-compare, which is turned on by > >> -Wextra (also known as -W) but not by -Wall. It's not turned on by > >> -Wall because it is not normally a problem. > > > That's stra

Re: Warning C vs C++

2005-09-18 Thread Florian Weimer
* Tommy Vercetti: >> The warning is controlled by -Wsign-compare, which is turned on by >> -Wextra (also known as -W) but not by -Wall. It's not turned on by >> -Wall because it is not normally a problem. > That's strange, all users I know expected it to turn ALL warnings, > hence name. Some pe

Re: Warning C vs C++

2005-09-17 Thread Gabriel Dos Reis
Tommy Vercetti <[EMAIL PROTECTED]> writes: | On Saturday 17 September 2005 17:18, Gabriel Dos Reis wrote: | > I would also encourage you to conduct a survey of bug frequency in | > codes of people who write programs using functions by *guessing* their | > meanings instead of reading the docs. | >

Re: Warning C vs C++

2005-09-17 Thread Gabriel Dos Reis
Tommy Vercetti <[EMAIL PROTECTED]> writes: | On Saturday 17 September 2005 17:45, you wrote: | > That's a real misunderstanding. There are many warnings that are very | > specialized, and if -Wall really turned on all warnings, it would be | > essentially useless. The idea behind -Wall is that it

Re: Warning C vs C++

2005-09-17 Thread Robert Dewar
Tommy Vercetti wrote: On Saturday 17 September 2005 17:45, you wrote: That's a real misunderstanding. There are many warnings that are very specialized, and if -Wall really turned on all warnings, it would be essentially useless. The idea behind -Wall is that it represents a comprehensive set o

Re: Warning C vs C++

2005-09-17 Thread Tommy Vercetti
On Saturday 17 September 2005 17:45, you wrote: > That's a real misunderstanding. There are many warnings that are very > specialized, and if -Wall really turned on all warnings, it would be > essentially useless. The idea behind -Wall is that it represents a > comprehensive set of warnings that mo

Re: Warning C vs C++

2005-09-17 Thread Robert Dewar
Tommy Vercetti wrote: On Saturday 17 September 2005 16:23, Gabriel Dos Reis wrote: then all you users you know don't read the doc. That is rather disappointing, but not uncommon. It's not that everyone reads manual, you should know. I personally only read it, when I am missing some piece of

Re: Warning C vs C++

2005-09-17 Thread Tommy Vercetti
On Saturday 17 September 2005 17:18, Gabriel Dos Reis wrote: > I would also encourage you to conduct a survey of bug frequency in > codes of people who write programs using functions by *guessing* their > meanings instead of reading the docs. > > I suspect you have much bigger issue to fix than com

Re: Warning C vs C++

2005-09-17 Thread Robert Dewar
Tommy Vercetti wrote: On Saturday 17 September 2005 16:23, Gabriel Dos Reis wrote: then all you users you know don't read the doc. That is rather disappointing, but not uncommon. It's not that everyone reads manual, you should know. I personally only read it, when I am missing some piece of

Re: Warning C vs C++

2005-09-17 Thread Robert Dewar
Tommy Vercetti wrote: On Saturday 17 September 2005 15:16, Ian Lance Taylor wrote: The warning is controlled by -Wsign-compare, which is turned on by -Wextra (also known as -W) but not by -Wall. It's not turned on by -Wall because it is not normally a problem. That's strange, all users

Re: Warning C vs C++

2005-09-17 Thread Gabriel Dos Reis
Tommy Vercetti <[EMAIL PROTECTED]> writes: | On Saturday 17 September 2005 16:23, Gabriel Dos Reis wrote: | > then all you users you know don't read the doc. That is rather | > disappointing, but not uncommon. | It's not that everyone reads manual, you should know. You may probably have missed t

Re: Warning C vs C++

2005-09-17 Thread Tommy Vercetti
On Saturday 17 September 2005 16:23, Gabriel Dos Reis wrote: > then all you users you know don't read the doc. That is rather > disappointing, but not uncommon. It's not that everyone reads manual, you should know. I personally only read it, when I am missing some piece of information. Do a surve

Re: Warning C vs C++

2005-09-17 Thread Gabriel Dos Reis
Tommy Vercetti <[EMAIL PROTECTED]> writes: | On Saturday 17 September 2005 15:16, Ian Lance Taylor wrote: | | > | > The warning is controlled by -Wsign-compare, which is turned on by | > -Wextra (also known as -W) but not by -Wall. It's not turned on by | > -Wall because it is not normally a

Re: Warning C vs C++

2005-09-17 Thread Joseph S. Myers
On Sat, 17 Sep 2005, Ian Lance Taylor wrote: > As far as I can tell, gcc does not warn about narrowing assignments. > I don't think people would object to adding such a warning, though > probably not under -Wall. If you want to make an enhancement request, > please file it at http://gcc.gnu.org/b

Re: Warning C vs C++

2005-09-17 Thread Tommy Vercetti
On Saturday 17 September 2005 15:16, Ian Lance Taylor wrote: > > The warning is controlled by -Wsign-compare, which is turned on by > -Wextra (also known as -W) but not by -Wall. It's not turned on by > -Wall because it is not normally a problem. That's strange, all users I know expected it t

Re: Warning C vs C++

2005-09-17 Thread Ian Lance Taylor
Vassili Karpov <[EMAIL PROTECTED]> writes: Since this e-mail is not about gcc development, it should have been sent to [EMAIL PROTECTED], not to [EMAIL PROTECTED] Thanks. > #include > > int main (int argc, char *argv[]) > { > char *s1 = argv[0]; > char *s2 = strchr (s1, '/'); > cha

Warning C vs C++

2005-09-17 Thread Vassili Karpov
Hello, Consider following snippet: #include int main (int argc, char *argv[]) { char *s1 = argv[0]; char *s2 = strchr (s1, '/'); char r; (void) argc; r = s2 ? (s2 - s1) : strlen (s1); return 0; } And the results of compilation: cvscxx$ gcc-4.0.0 -Wall -Werror -c cvsc