OrchidTechnologies / orchid

Orchid: VPN, Personal Firewall
https://www.orchid.com/
GNU Affero General Public License v3.0
649 stars 103 forks source link

error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] #123

Closed Strasser-Pablo closed 2 years ago

Strasser-Pablo commented 2 years ago

Describe the bug Trying to compile the software on ubuntu focal give the following warning which was upgraded to warning because of werror.

The exact error message is:

vpn/./quickjs/quickjs.c:10741:30: error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
                else if (d > INT64_MAX)
                           ~ ^~~~~~~~~
/usr/include/stdint.h:124:22: note: expanded from macro 'INT64_MAX'
# define INT64_MAX              (__INT64_C(9223372036854775807))
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdint.h:106:24: note: expanded from macro '__INT64_C'
#  define __INT64_C(c)  c ## L
                        ^~~~~~
<scratch space>:166:1: note: expanded from here
9223372036854775807L`

To Reproduce Steps to reproduce the behavior:

  1. Setup the machine using the setup-lnx.sh script.
  2. Make on the root directory.

Expected behavior Not having the warning/error.

Device information:

saurik commented 2 years ago

I'm sorry this took so long but I kind of wanted to diagnose the underlying issue here to file a good bug report upstream to QuickJS, but I finally decided to timebox that task and just take the 30-seconds of effort (and the many hours of CI ;P) to commit this with a XXX comment to punt that work to later (which made me realize that I'd already punted this exact same issue last August). Regardless: this was fixed in ccfc3b16136b727b4504e165f8dacd88e0b6d532.