Makefile: WARNINGS: add -Wdouble-promotion
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 29 May 2012 08:32:06 +0000 (10:32 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 29 May 2012 13:19:31 +0000 (15:19 +0200)
commitf30b82fd52f523a86d93ffe9a1bede7149833c64
treeb5cab8552c31ab975f30c31912b2c77bc2ea4f35
parent69b28598cc3fac7399b2c8c905e8e6470e5bc842
Makefile: WARNINGS: add -Wdouble-promotion

-Wdouble-promotion (C, C++, Objective-C and Objective-C++ only)
   Give a warning when a value of type "float" is implicitly promoted to
   "double".  CPUs with a 32-bit "single-precision" floating-point unit
   implement "float" in hardware, but emulate "double" in software.  On
   such a machine, doing computations using "double" values is much more
   expensive because of the overhead required for software emulation.

   It is easy to accidentally do computations with "double" because
   floating-point literals are implicitly of type "double".
   For example, in:

           float area(float radius)
           {
              return 3.14159 * radius * radius;
           }

   the compiler will perform the entire computation with "double"
   because the floating-point literal is a "double".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
18 files changed:
Makefile.inc
lib/bmf/src/NetworkInterfaces.c
lib/httpinfo/src/admin_interface.c
lib/httpinfo/src/olsrd_httpinfo.c
lib/jsoninfo/src/olsrd_jsoninfo.c
lib/nameservice/src/mapwrite.c
lib/nameservice/src/nameservice.c
lib/tas/src/plugin.c
src/cfgparser/cfgfile_gen.c
src/cfgparser/olsrd_conf.c
src/cfgparser/oparse.y
src/hysteresis.c
src/link_set.c
src/lq_plugin_default_ffeth.c
src/lq_plugin_default_float.c
src/lq_plugin_default_fpm.c
src/main.c
src/scheduler.c