Hello Andrew,
On 06/17/11 18:31, Andrew Johnson wrote:
> Hi Michael,
>
> On 2011-06-17 Michael Davidsaver wrote:
>> I'd like to add a standard 64-bit integer type to epicsTypes.h.
>> Currently this is only available when compiling with the C99 extensions
>> enabled.
>>
>> Attached are two proposed patches. The first adds sanity checks of the
>> existing type sizes. The second defines epicsUInt64 and epicsInt64.
>>
>> The C primitive used (either long or long long) is chosen by testing the
>> size of LONG_MAX. I think this should work for all toolchains which
>> actually provide a 64-bit integer type. The question is, are there any
>> which don't and need to be supported?
>
> There were issues with using long long on some vxWorks versions/architectures,
> although from what I can see they were only in vxWorks 5.3.x releases and the
> later releases apparently do provide full support. I believe there were some
> support routines that gcc calls implicitly which the OS relegated to an
> external libgcc.a library rather than building them into the OS image.
Does sizeof(long)==8 in these cases? If it does then there is no need
for long long.
> I would suggest moving your verification code into libCom/test and adding a
> test program to the file that exercises the basic operations +-*/&|^~ with the
> epicsInt64 and epicsUInt64 types to ensure they are all implemented. The
> tests in libCom/test are intended to help us confirm that the OS properly
> implements all the facilities we need/expect.
My reason for not wanting to put these tests in libCom/test is that they
are most useful when compiled before everything else. These checks are
the sort usually found in autoconf ./configure scripts.
I was tempted to put them into epicsTypes.h directly.
> Are you looking for this in 3.14.x or 3.15?
Certainly 3.15.
I would also like to see it added to 3.14, if this can be done without
breaking compatibility with old vxWorks versions. It is really up to
you to decide if this can be done.
> - Andrew
- Replies:
- Re: 64 bit integers (aka. long or long long) Andrew Johnson
- References:
- 64 bit integers (aka. long or long long) Michael Davidsaver
- Re: 64 bit integers (aka. long or long long) Andrew Johnson
- Navigate by Date:
- Prev:
Re: 64 bit integers (aka. long or long long) Andrew Johnson
- Next:
Re: 64 bit integers (aka. long or long long) Benjamin Franksen
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: 64 bit integers (aka. long or long long) Andrew Johnson
- Next:
Re: 64 bit integers (aka. long or long long) Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|