Opened 8 years ago

Last modified 8 years ago

#13220 assigned bug

[Interface Kit] AffineTransform.h doesn't compile with -pendantic

Reported by: diver Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

hrev50880 x86_64

/system/develop/headers/os/interface/AffineTransform.h doesn't compile with -pendantic gcc option

kBuild: Compiling VBoxTray - /sources/VirtualBox-5.1.12/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
In file included from /boot/system/develop/headers/os/interface/View.h:9:0,
                 from /boot/system/develop/headers/os/interface/Window.h:11,
                 from /boot/system/develop/headers/os/interface/Alert.h:11,
                 from /sources/VirtualBox-5.1.12/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp:54:
/boot/system/develop/headers/os/interface/AffineTransform.h:37:42: error: floating-point literal cannot appear in a constant-expression
  static const double   kDefaultEpsilon = 1e-14;
                                          ^
kmk: *** [/sources/VirtualBox-5.1.12/out/haiku.amd64/strict/obj/VBoxTray/VBoxGuestApplication.o] Error 1
The failing command:
@g++ -c -O2 -g -pipe -pedantic -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-unused-parameter    -Wlogical-op   -Wno-variadic-macros -Wno-long-long  -Wno-overloaded-virtual -Wno-variadic-macros -O2 -mtune=generic -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT   -fno-pic -fno-exceptions -m64 -I/sources/VirtualBox-5.1.12/src/VBox/Additions/haiku/include -I/sources/VirtualBox-5.1.12/out/haiku.amd64/strict/obj/VBoxTray/dtrace -I/sources/VirtualBox-5.1.12/include -I/sources/VirtualBox-5.1.12/out/haiku.amd64/strict -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_REM -DVBOX_WITH_RAW_MODE -DRT_STRICT -DVBOX_STRICT -DRT_OS_HAIKU -DRT_ARCH_AMD64 -D__AMD64__ -DVBOX_WITH_DEBUGGER -DRT_LOCK_STRICT -DRT_LOCK_STRICT_ORDER -DRTPATH_APP_PRIVATE=\"/boot/system/apps/VirtualBox\" -DRTPATH_APP_PRIVATE_ARCH=\"/boot/system/apps/VirtualBox\" -DRTPATH_SHARED_LIBS=\"/boot/system/apps/VirtualBox\" -DRTPATH_APP_DOCS=\"/boot/system/apps/VirtualBox\" -DIN_RING3 -DIN_GUEST -DIN_GUEST_R3 -DIN_RT_R3 -DGC_ARCH_BITS=64 -DVBOX_WITH_HGCM -DLOG_TO_BACKDOOR -DLOG_ENABLED -DVBOX_SVN_REV=112440 -Wp,-MD,/sources/VirtualBox-5.1.12/out/haiku.amd64/strict/obj/VBoxTray/VBoxGuestApplication.o.dep -Wp,-MT,/sources/VirtualBox-5.1.12/out/haiku.amd64/strict/obj/VBoxTray/VBoxGuestApplication.o -Wp,-MP -o /sources/VirtualBox-5.1.12/out/haiku.amd64/strict/obj/VBoxTray/VBoxGuestApplication.o /sources/VirtualBox-5.1.12/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
kmk: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!
Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 2
keeping chroot folder /data/ports/app-emulation/virtualbox-guest-additions/work-5.1.12 intact for inspection

Change History (4)

comment:1 by axeld, 8 years ago

There is no way to make this code compile with -pedantic without using C++11. I'd suggest replacing BAffineTransform::kDefaultEpsilon with a #define B_DEFAULT_EPSILON. Anyone against this solution? Should the define only be used locally in that file, or should it be usable for others, too?

comment:2 by pulkomandy, 8 years ago

Can't we just use FLT_MIN or FLT_EPSILON?

comment:3 by axeld, 8 years ago

That would be DBL_EPSILON, in this case. I dunno, it's a different value (2.2204460492503131e-16 vs. 1e-14). This only affects validity, equality, and IsIdentity(), but I don't know if this would have any actual consequences; it definitely used in some places.

comment:4 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.