[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#119440: marked as done (g++: Compiler does not give any errors when a function fails to return required value)



Your message dated Wed, 14 Nov 2001 00:28:30 +0200
with message-id <E163m2j-0000BY-00@orion.exa.homeip.net>
and subject line closing this one
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Nov 2001 15:55:40 +0000
>From erayo@cs.bilkent.edu.tr Tue Nov 13 09:55:39 2001
Return-path: <erayo@cs.bilkent.edu.tr>
Received: from venus1.ttnet.net.tr [212.156.4.3] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 163fuV-0008Ai-00; Tue, 13 Nov 2001 09:55:39 -0600
Received: from orion.exa.homeip.net ([195.174.160.184]) by
          venus1.ttnet.net.tr (Netscape Messaging Server 4.15) with ESMTP
          id GMQXKI01.Y7M; Tue, 13 Nov 2001 18:55:30 +0300 
Received: from exa by orion.exa.homeip.net with local (Exim 3.32 #1 (Debian))
	id 163ft9-0005i2-00; Tue, 13 Nov 2001 17:54:15 +0200
From: "Eray Ozkural (exa)" <erayo@cs.bilkent.edu.tr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: g++: Compiler does not give any errors when a function fails to return required value
X-Reportbug-Version: 1.31
X-Mailer: reportbug 1.31
Date: Tue, 13 Nov 2001 17:54:14 +0200
Message-Id: <[🔎] E163ft9-0005i2-00@orion.exa.homeip.net>
Sender: Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Delivered-To: submit@bugs.debian.org

Package: g++
Version: 2:2.95.4-8
Severity: normal

In a member function such as:
int Partition::in_which_part()
{
  int i;
  ....
}

A return statement with type of int is required. However, the compiler
fails to give any error/warning when the corresponding return statement
is omitted, when invoked with default options.

In the current case, the compiler does not even give a warning message
by default. Giving an error message might break valid C++ code (which
I'm not sure of) but it seems that when you specify -Wall the compiler
will detect whether
src/generic/Utility.hxx:173: warning: control reaches end of non-void function `Utility::operator <<<int, less<int> >(ostream &, const set<int,less<int>,allocator<int> > &)'

I think this should be the default behavior, which may be suppressed
with a flag if desired.

Thanks,

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux orion 2.4.7 #1 Tue Jul 31 12:20:28 EEST 2001 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages g++ depends on:
ii  cpp                    2:2.95.4-8        The GNU C preprocessor.
ii  g++-2.95               1:2.95.4-0.011006 The GNU C++ compiler.
ii  gcc-2.95               1:2.95.4-0.011006 The GNU C compiler.


---------------------------------------
Received: (at 119440-done) by bugs.debian.org; 13 Nov 2001 22:30:20 +0000
>From erayo@cs.bilkent.edu.tr Tue Nov 13 16:30:20 2001
Return-path: <erayo@cs.bilkent.edu.tr>
Received: from venus1.ttnet.net.tr [212.156.4.3] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 163m4P-0008BP-00; Tue, 13 Nov 2001 16:30:20 -0600
Received: from orion.exa.homeip.net ([195.174.160.184]) by
          venus1.ttnet.net.tr (Netscape Messaging Server 4.15) with ESMTP
          id GMRFTP01.PC4 for <119440-done@bugs.debian.org>; Wed, 14 Nov
          2001 01:29:49 +0300 
Received: from exa by orion.exa.homeip.net with local (Exim 3.32 #1 (Debian))
	id 163m2j-0000BY-00
	for <119440-done@bugs.debian.org>; Wed, 14 Nov 2001 00:28:33 +0200
Content-Type: text/plain;
  charset="iso-8859-1"
From: "Eray Ozkural (exa)" <erayo@cs.bilkent.edu.tr>
Organization: Bilkent University CS Dept.
To: 119440-done@bugs.debian.org
Subject: closing this one
Date: Wed, 14 Nov 2001 00:28:30 +0200
X-Mailer: KMail [version 1.3.2]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Message-Id: <E163m2j-0000BY-00@orion.exa.homeip.net>
Sender: Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Delivered-To: 119440-done@bugs.debian.org

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

thanks,

- -- 
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara
www: http://www.cs.bilkent.edu.tr/~erayo
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE78Z6QfAeuFodNU5wRAoLDAJ95xjKE2V9LMq/QvbHsCaZFEa+jVQCfR7zy
fF+f09YKOg6RRr3AE6ILS3A=
=nQl8
-----END PGP SIGNATURE-----



Reply to: