Skip to content

implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion] #346

@zafersn

Description

@zafersn

Hi,

having a compile time warning...

  • target platform

  • STM32U575

  • zephyrOS 3.6.0

  • zephyr-sdk-0.16.5

LOG OUTPUT:

../lr11xx/lr11xx_driver/src/lr11xx_gnss.c: In function 'lr11xx_gnss_compute_power_consumption':
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:973:65: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  973 |         ( ( float ) instantaneous_power_consumption_ua->init_ua / 1000.0 * ( float ) cumulative_timing->init ) /
      |                                                                 ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:973:74: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  973 |         ( ( float ) instantaneous_power_consumption_ua->init_ua / 1000.0 * ( float ) cumulative_timing->init ) /
      |                                                                          ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:976:99: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  976 |     float e_gps_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_capture_ua / 1000.0 *
      |                                                                                                   ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:976:108: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  976 |     float e_gps_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_capture_ua / 1000.0 *
      |                                                                                                            ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:978:102: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  978 |                             ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
      |                                                                                                      ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:978:111: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  978 |                             ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
      |                                                                                                               ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:982:99: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  982 |     float e_gps_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_process_ua / 1000.0 *
      |                                                                                                   ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:982:108: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  982 |     float e_gps_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_process_ua / 1000.0 *
      |                                                                                                            ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:984:102: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  984 |                             ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
      |                                                                                                      ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:984:111: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  984 |                             ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
      |                                                                                                               ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:988:90: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  988 |     float e_gps_sleep_32k = ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                          ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:988:99: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  988 |     float e_gps_sleep_32k = ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                                   ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:994:105: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  994 |     float e_beidou_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_capture_ua / 1000.0 *
      |                                                                                                         ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:994:114: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  994 |     float e_beidou_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_capture_ua / 1000.0 *
      |                                                                                                                  ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:996:108: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  996 |                                ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
      |                                                                                                            ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:996:117: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  996 |                                ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
      |                                                                                                                     ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:999:105: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  999 |     float e_beidou_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_process_ua / 1000.0 *
      |                                                                                                         ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:999:114: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  999 |     float e_beidou_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_process_ua / 1000.0 *
      |                                                                                                                  ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1001:108: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1001 |                                ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
      |                                                                                                            ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1001:117: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1001 |                                ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
      |                                                                                                                     ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1013:94: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1013 |         e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
      |                                                                                              ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1013:103: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1013 |         e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
      |                                                                                                       ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1015:94: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1015 |                     ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
      |                                                                                              ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1015:103: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1015 |                     ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
      |                                                                                                       ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1017:82: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1017 |                     ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                  ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1017:91: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1017 |                     ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                           ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1019:88: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1019 |                     ( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
      |                                                                                        ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1019:97: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1019 |                     ( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
      |                                                                                                 ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1025:97: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1025 |         e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
      |                                                                                                 ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1025:106: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1025 |         e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
      |                                                                                                          ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1027:97: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1027 |                     ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
      |                                                                                                 ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1027:106: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1027 |                     ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
      |                                                                                                          ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1029:82: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1029 |                     ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                  ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1029:91: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1029 |                     ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
      |                                                                                           ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1031:88: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1031 |                     ( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
      |                                                                                        ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1031:97: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1031 |                     ( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
      |                                                                                                 ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1037:87: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1037 |                                       ( 3600.0 - ( ( float ) cumulative_timing->total / 32768.0 ) );
      |                                                                                       ^
../lr11xx/lr11xx_driver/src/lr11xx_gnss.c:1036:98: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
 1036 |     float power_consumption_uah_tmp = ( ( e_init + e_tot_gps + e_tot_beidou + e_demod ) * 1000 ) /


..lr11xx/lr11xx_driver/src/lr11xx_wifi.c:571:48: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  571 |                                 ( 3600000000.0 - ( ( float ) timing.rx_capture_us + ( float ) timing.demodulation_us +
      |                                                ^
..lr11xx/lr11xx_driver/src/lr11xx_wifi.c:570:59: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  570 |     wifi_scan_consumption_nah = wifi_scan_consumption_nah /
      |                                                           ^
..lr11xx/lr11xx_driver/src/lr11xx_wifi.c:576:35: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  576 |         wifi_scan_consumption_nah *= 2.0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions