Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why might using a "long long" in C or C++ be a bad thing?

Tags:

c++

c

gcc

Why might using a "long long" in C or C++ be a bad thing?

I was compiling a runtime library the other day and in the code it checks to see if longs are 64bits and if not it uses a long long. But along with that, it sends out a #warning "using long long". I can't think of any reason for the "long long" being a warning unless it was leftover debug cruft from the developer.

Thanks Chenz

like image 288
Crazy Chenz Avatar asked Nov 28 '22 08:11

Crazy Chenz


1 Answers

As far as I know, long long is currently standard only in C99. It will also be a type in C++0x, but most modern compilers should support it already.

However, for fixed-sized integers one might use the C99 header <stdint.h>, or in C++ <boost/cstdint.hpp>

like image 169
UncleBens Avatar answered Dec 05 '22 11:12

UncleBens