Suppose your source c++ program is the one line #include <maht.h> and you compile it with "g++ -O -I/usr/include Then, you get the following failure: cc1plus: warning: changing search order for system directory "/usr/include" cc1plus: warning: as it has already been specified as a non-system directory In file included from /usr/include/math.h:350, from c.cc:1: /usr/include/bits/mathinline.h:216: declaration of `double fdim(double, double) ' throws different exceptions /usr/include/bits/mathcalls.h:313: than previous declaration `double fdim(double, double) throw ()' /usr/include/bits/mathinline.h:223: declaration of `float fdimf(float, float)' throws different exceptions /usr/include/bits/mathcalls.h:313: than previous declaration `float fdimf(float, float) throw ()' The work-around is easy in principle: don't "-I/usr/include" This gets painful, however, with a product like omniORB (free CORBA) which has lots of little included makefile sources all of which have lines like CXXFLAGS += -I$(PYPREFIX)/include (And the python directory is supplied from asking python: PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix') An unacceptable fix is to specify -O0; A terrible solution is to put #include <cmath> in front of the #include <math.h>
yep. i fix packages nearly every day which included -I/usr/include. -I/usr/include is wrong and must be changed (see gcc-dev for the reasons). standard procedure is to fix the build system not to -I/usr/include and then send the patch upstream.