Hi Eric,
On 11/10/2015 01:48 PM, Eric Norum wrote:
> I tried to add some code that uses 64 bit integers:
> static epicsInt64
...
> My questions, after that long-winded introduction are, “Given that the
> default gcc options preclude the use of 64 bit values, what -std value
> should be used? Should the appropriate -std=xxxx be added
> to CONFIG.gnuCommon?"
No. If you try to build Base-3.14 with __STDC_VERSION__ >= 199901L the
result won't necessarily compile -- I tried it once, which prompted me
to remove that conditional and the use of inttypes.h from epicsTypes.h
in the 3.15 releases.
Setting -std=gnu99 or similar will never cause the C++ compiler to
define __STDC_VERSION__ anyway, so those versions of epicsInt64 and
epicsUInt64 would never be available for C++ code.
Jeff Hill added those alternative typedef's to epicsTypes.h back in
2006, but evidently never tested it properly. 2 years later I tried
changing the epicsInt8 typedef to be 'signed char' but the result would
not compile on architectures where char is unsigned.
The 64-bit epicsInt types are available in all 3.15 releases of Base,
and I even have a branch where I have been adding support for 64-bit
field types to the IOC, but that would require changes to some external
device support so I haven't merged it yet.
If you need a portable 64-bit integer for code that must build against
3.14, use 'long long' which works on all our supported architectures.
- Andrew
--
Light thinks it travels faster than anything but it is wrong.
No matter how fast light travels, it finds the darkness has
always got there first, and is waiting for it.
-- Terry Pratchett, Reaper Man
- References:
- __STDC_VERSION__ weirdness Eric Norum
- Navigate by Date:
- Prev:
__STDC_VERSION__ weirdness Eric Norum
- Next:
Re: Advice on VME processor cards and OS for EPICS Michael Davidsaver
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
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:
__STDC_VERSION__ weirdness Eric Norum
- Next:
motor record DLY and STOP problem Pearson, Matthew R.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|