EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: -D__STDC_VERSION__=199901L
From: "Johnson, Andrew N." <[email protected]>
To: "Pearson, Matthew R." <[email protected]>
Cc: "[email protected] list" <[email protected]>
Date: Sat, 6 Sep 2014 02:00:41 +0000
Hi Matt,

The logic in epicsTypes.h will not work for C++ code because the compiler doesn't define that macro (and adding -std=c99 or gnu99 is a C standard only, g++ will reject it). I have fixed the epicsTypes.h file for the upcoming 3.15 release, but for 3.14 we couldn't support 64-bit types because we had to be able to build on VxWorks 5.4.2 which does not provide them on all architectures.

Until 3.15.1 comes out I recommend just using long long, which maps to 64-bit integers on all our main architectures — on Windows long is only 32 bits wide. Note though that even VxWorks 6.x does not provide strtoll() or strtoull(), but Base 3.15.1 will provide them.

- Andrew

-- 
Sent from my iPad

> On Sep 5, 2014, at 18:40, "Pearson, Matthew R." <[email protected]> wrote:
> 
> 
> Hi,
> 
> I noticed that epicsUInt64 is not defined on my 64-bit system. In epicsTypes.h I see:
> 
> #if __STDC_VERSION__ >= 199901L
>    typedef int8_t          epicsInt8;
>    typedef uint8_t         epicsUInt8;
>    typedef int16_t         epicsInt16;
>    typedef uint16_t        epicsUInt16;
>    typedef epicsUInt16     epicsEnum16;
>    typedef int32_t         epicsInt32;
>    typedef uint32_t        epicsUInt32;
>    typedef int64_t         epicsInt64;
>    typedef uint64_t        epicsUInt64;
> #else
>    typedef char            epicsInt8;
>    typedef unsigned char   epicsUInt8;
>    typedef short           epicsInt16;
>    typedef unsigned short  epicsUInt16;
>    typedef epicsUInt16     epicsEnum16;
>    typedef int             epicsInt32;
>    typedef unsigned int    epicsUInt32;
> #endif
> 
> So I tried setting -D__STDC_VERSION__=199901L in:
> configure/os/CONFIG.Common.linuxCommon
> 
> But I suspect that's the wrong way to do it, because base failed to compile:
> 
> /usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500 -D__STDC_VERSION__=199901L           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -g   -Wall      -m64     -fPIC -MMD -I. -I../O.Common -I. -I.. -I../../../include/os/Linux -I../../../include        ../cac.cpp 
> In file included from ../comBuf.h:34,
>                 from ../cac.h:44,
>                 from ../cac.cpp:39:
> ../../../include/osiWireFormat.h: In function ‘void WireSet(const T&, epicsUInt8*) [with T = char]’:
> ../comBuf.h:237:   instantiated from ‘unsigned int comBuf::push(const T*, unsigned int) [with T = char]’
> ../comQueSend.h:123:   instantiated from ‘void comQueSend::push(const T*, unsigned int) [with T = char]’
> ../comQueSend.h:206:   instantiated from here
> ../../../include/osiWireFormat.h:208: error: ‘tmp’ has incomplete type
> 
> 
> But I'm sure many people are using C99. Any ideas?
> 
> Cheers,
> Matt
> 
> 
> ps.
> 
> [mkp@bl99-dassrv1 base]$ rpm -q libstdc++
> libstdc++-4.4.7-3.el6.x86_64
> [mkp@bl99-dassrv1 base]$ g++ -v
> Using built-in specs.
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
> 
> 
> 
> 
> Data Acquisition and Control Engineer
> Spallation Neutron Source
> Oak Ridge National Lab
> 
> 
> 
> 
> 
> 


References:
-D__STDC_VERSION__=199901L Pearson, Matthew R.

Navigate by Date:
Prev: Re: -D__STDC_VERSION__=199901L matthieu bec
Next: Re: areaDetector 1.9.1 "dyld: Symbol not found" on Darwin J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: -D__STDC_VERSION__=199901L matthieu bec
Next: mbboDirect problems Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·