kio trash and 64bit

Harald Sitter sitter at kde.org
Wed Apr 30 14:26:34 UTC 2014


alohas,

today I noticed that kio-extras fails to build on Kubuntu 14.04 32bit
with the following lovely error:

/build/buildd/project-neon5-kio-extras-0.0+git20140430.0800+neon4~4ab0de2~14.04/trash/trashimpl.cpp:225:57:
error: size of array 'off_t_should_be_64bit' is negative

which comes from this peculiar line

char off_t_should_be_64bit[sizeof(off_t) >= 8 ? 1:-1];
(void)off_t_should_be_64bit;

this line should not:
- exist (as this is something one can very neatly test with cmake, at
configuration time, with an isolated test file, while not making the
entire build fail half way through)
and in particular:
- produce random build failure
- check a posix defined type that may be anywhere between 8bit and a
godzillion bit wide and then complain that it is not above the
arbitrary threshold it thinks the type should have

random google search says this function may want to use the GCC
extension off64_t btw

HS


More information about the Plasma-devel mailing list