octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #62212] Wrong unsigned integer overflow with c


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #62212] Wrong unsigned integer overflow with clang
Date: Wed, 23 Mar 2022 11:56:16 -0400 (EDT)

Follow-up Comment #2, bug #62212 (project octave):

I'm very confused by the minimum reproducer you posted. I named it
clangtest.cpp, and look at what I get:


$ echo $CFLAGS $CXXFLAGS $FFLAGS

$ g++ --version
g++ (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ clangtest.cpp && ./a.out
db_large_integer: 1.84467e+19
ui64_large_integer: 18446744073709551615

$ clang++ --version
clang version 13.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ clang++ clangtest.cpp && ./a.out
db_large_integer: 1.84467e+19
ui64_large_integer: 93882097565731


For me, GCC 11.2 returns 18446744073709551615 not 0, and Clang 13.0.1 returns
the completely inexplicable 93882097565731 which is not even the correct order
of magnitude! It is only some 2^46 or 2^47, not even close to 2^64.

What am I doing wrong?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62212>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]