public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++
@ 2003-08-20 10:23 gerald at pfeifer dot com
  2003-08-20 14:25 ` [Bug libstdc++/11990] " bangerth at dealii dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gerald at pfeifer dot com @ 2003-08-20 10:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990

           Summary: "operand of conditional has no effect" warnings in
                    libstdc++
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gerald at pfeifer dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-unknown-freebsd4.8

Compile the following with -O3 -Wall:

  #include <iostream>

  using namespace std;

  int main(int argc, char **) {
    cout << "argc = " << argc;
  }

Current CVS issues the following warnings:

/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:
In
   static member function `static void std::__pad<_CharT, 
   _Traits>::_S_pad(std::ios_base&, _CharT, _CharT*, const _CharT*, streamsize, 
   streamsize, bool) [with _CharT = char, _Traits = std::char_traits<char>]':
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:649:
  instantiated from `void std::num_put<_CharT, _OutIter>::_M_pad(_CharT,
streamsize, std::ios_base&, _CharT*, const _CharT*, int&) const [with _CharT =
char, _OutIter = std::ostreambuf_iterator<char, std::char_traits<char> >]'
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:837:
  instantiated from `_OutIter std::num_put<_CharT,
_OutIter>::_M_insert_int(_OutIter, std::ios_base&, _CharT, _ValueT) const [with
_ValueT = long unsigned int, _CharT = char, _OutIter =
std::ostreambuf_iterator<char, std::char_traits<char> >]'
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:1049:
  instantiated from `_OutIter std::num_put<_CharT, _OutIter>::do_put(_OutIter,
std::ios_base&, _CharT, long unsigned int) const [with _CharT = char, _OutIter =
std::ostreambuf_iterator<char, std::char_traits<char> >]'
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.h:944:
  instantiated from `_OutIter std::num_put<_CharT, _OutIter>::put(_OutIter,
std::ios_base&, _CharT, long unsigned int) const [with _CharT = char, _OutIter =
std::ostreambuf_iterator<char, std::char_traits<char> >]'
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/ostream.tcc:224:
  instantiated from `std::basic_ostream<_CharT, _Traits>&
std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT
= char, _Traits = std::char_traits<char>]'
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/ostream:196:
  instantiated from `std::basic_ostream<_CharT, _Traits>&
std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char,
_Traits = std::char_traits<char>]'
x.cc:6:   instantiated from here
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:2241:
warning: second
   operand of conditional has no effect
/gcc-current/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/../../../../include/c++/3.4/bits/locale_facets.tcc:2241:
warning: third
   operand of conditional has no effect


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
@ 2003-08-20 14:25 ` bangerth at dealii dot org
  2003-08-23  1:23 ` dhazeghi at yahoo dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-08-20 14:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at redhat dot com
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |libstdc++
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-20 14:25:52
               date|                            |


------- Additional Comments From bangerth at dealii dot org  2003-08-20 14:25 -------
Confirmed. 
 
That's pretty odd code anyway: the line in question reads 
	      _Traits::eq((__news[0] = __olds[0]), __plus) ? __plus : __minus; 
and __plus and __minus are of type "const _CharT". In other words, the 
conditional really seems to have no effect. 
 
This line was checked into the file as part of version 1.78, in this commit: 
revision 1.78 
date: 2002/07/31 02:47:33;  author: bkoz;  state: Exp;  lines: +88 -74 
branches:  1.78.2;  1.78.4; 
 
2002-07-30  Benjamin Kosnik  <bkoz@redhat.com> 
            Gabriel Dos Reis  <gdr@nerim.net> 
 
	* include/bits/char_traits.h: Remove generic definitions. 
	* include/bits/streambuf_iterator.h (istreambuf_iterator): Use 
	eof, not -2. 
       [...lots more...] 
 
Benjamin, do you recall what the line was good for? 
 
W.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
  2003-08-20 14:25 ` [Bug libstdc++/11990] " bangerth at dealii dot org
@ 2003-08-23  1:23 ` dhazeghi at yahoo dot com
  2003-08-23  7:04 ` gerald at pfeifer dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23  1:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
  2003-08-20 14:25 ` [Bug libstdc++/11990] " bangerth at dealii dot org
  2003-08-23  1:23 ` dhazeghi at yahoo dot com
@ 2003-08-23  7:04 ` gerald at pfeifer dot com
  2003-08-23 12:15 ` [Bug libstdc++/11990] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gerald at pfeifer dot com @ 2003-08-23  7:04 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990



------- Additional Comments From gerald at pfeifer dot com  2003-08-23 07:04 -------
Subject: Re:  "operand of conditional has no effect"
 warnings in libstdc++

On Sat, 23 Aug 2003, dhazeghi at yahoo dot com wrote:
> dhazeghi at yahoo dot com changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>    Target Milestone|3.4                         |---

This is a clear, and very bad regression on mainline!  Why did you remove
the 3.4 milestone??

Gerald


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] [3.4 Regression] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
                   ` (2 preceding siblings ...)
  2003-08-23  7:04 ` gerald at pfeifer dot com
@ 2003-08-23 12:15 ` pinskia at gcc dot gnu dot org
  2003-08-23 16:00 ` dhazeghi at yahoo dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-23 12:15 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
            Summary|"operand of conditional has |[3.4 Regression] "operand of
                   |no effect" warnings in      |conditional has no effect"
                   |libstdc++                   |warnings in libstdc++
   Target Milestone|---                         |3.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] [3.4 Regression] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
                   ` (3 preceding siblings ...)
  2003-08-23 12:15 ` [Bug libstdc++/11990] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-08-23 16:00 ` dhazeghi at yahoo dot com
  2003-08-24 14:59 ` gerald at pfeifer dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 16:00 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990



------- Additional Comments From dhazeghi at yahoo dot com  2003-08-23 16:00 -------
Apologies. I misread the description of the problem.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] [3.4 Regression] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
                   ` (4 preceding siblings ...)
  2003-08-23 16:00 ` dhazeghi at yahoo dot com
@ 2003-08-24 14:59 ` gerald at pfeifer dot com
  2003-08-29 17:40 ` cvs-commit at gcc dot gnu dot org
  2003-08-29 17:45 ` paolo at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: gerald at pfeifer dot com @ 2003-08-24 14:59 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990



------- Additional Comments From gerald at pfeifer dot com  2003-08-24 14:59 -------
Patch at http://gcc.gnu.org/ml/libstdc++/2003-08/msg00214.html


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] [3.4 Regression] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
                   ` (5 preceding siblings ...)
  2003-08-24 14:59 ` gerald at pfeifer dot com
@ 2003-08-29 17:40 ` cvs-commit at gcc dot gnu dot org
  2003-08-29 17:45 ` paolo at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-08-29 17:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-08-29 17:40 -------
Subject: Bug 11990

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2003-08-29 17:40:12

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: locale_facets.tcc 

Log message:
	2003-08-29  Nathan Myers  <ncm@cantrip.org>
	
	PR libstdc++/11990
	* include/bits/locale_facets.tcc (__pad): delete dead code.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.1946&r2=1.1947
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.110&r2=1.111


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/11990] [3.4 Regression] "operand of conditional has no effect" warnings in libstdc++
  2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
                   ` (6 preceding siblings ...)
  2003-08-29 17:40 ` cvs-commit at gcc dot gnu dot org
@ 2003-08-29 17:45 ` paolo at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-08-29 17:45 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11990


paolo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From paolo at gcc dot gnu dot org  2003-08-29 17:45 -------
Fixed.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-08-29 17:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 10:23 [Bug c++/11990] New: "operand of conditional has no effect" warnings in libstdc++ gerald at pfeifer dot com
2003-08-20 14:25 ` [Bug libstdc++/11990] " bangerth at dealii dot org
2003-08-23  1:23 ` dhazeghi at yahoo dot com
2003-08-23  7:04 ` gerald at pfeifer dot com
2003-08-23 12:15 ` [Bug libstdc++/11990] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-08-23 16:00 ` dhazeghi at yahoo dot com
2003-08-24 14:59 ` gerald at pfeifer dot com
2003-08-29 17:40 ` cvs-commit at gcc dot gnu dot org
2003-08-29 17:45 ` paolo at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).