why does g++ not warn about division by zero?

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

 



Hi,

i am wondering a bit why g++ (version 4.3.3,Ubunut-Jaunty,32-Bit) does not warn about a divsion by zero. I created a testcase do demonstrate:


#include <iostream>

template <typename T1, typename T2> inline T1 foo (T1 const& a, T2 const& b)
{
	// ....
    return a/b;
}

int main()
{
	std::cout << foo(4.,0) << std::endl; 
	return 0;  
}

I compiled the testprogramm with following command:
g++ -W -Wall -pedantic -o test test.cpp

g++ does not raise a warning!


Best regards 

Ettl Martin




-- 
GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und Telefonanschluss
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux