Clang++ stdlib/cstdlib.h workaround

Shane Ambler FreeBSD at ShaneWare.Biz
Thu Jul 5 06:41:21 UTC 2018


On 04/07/2018 22:00, Antonio Olivares wrote:

> About the big number, it would be nice to get it working for bigger
> numbers, but I would need to run it on amd64 freebsd machine at work.
> Maybe at some other time we can revisit this issue.  Thank you for your
> assistance.

You don't need a 64bit machine to use 64bit ints but you do need to use
a recent C/C++ standard, long long was introduced in C99 and C++11. That
is, if you have an issue with long long add -std=c++11 to your CXXFLAGS.

https://en.wikipedia.org/wiki/Integer_(computer_science)#Long_long

There is also a long double

https://en.wikipedia.org/wiki/Long_double

Try it -

#include <stdio.h>

int main()
{
    printf("sizeof long long - %lu\n",sizeof(long long));
    printf("sizeof long double - %lu\n",sizeof(long double));
    return 0;
}


-- 
FreeBSD - the place to B...Software Developing

Shane Ambler



More information about the freebsd-questions mailing list