EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1740426] Re: portable printf() spec for size_t, long long, and others
From: Martin Konrad via Core-talk <[email protected]>
To: [email protected]
Date: Tue, 07 Jan 2020 00:24:54 -0000
Considering the fact that issues related to these constructs are popping
up again and again I would also like to see this addressed.

Fixed-width integer types are provided by stdint.h since C99
(https://en.wikipedia.org/wiki/C_data_types#stdint.h). In the case of
GCC it seems like the standard library ships with this feature since 4.5
(see https://gcc.gnu.org/c99status.html). MSVC includes the required
macros in 2015+ (https://docs.microsoft.com/en-us/cpp/standard-
library/cstdint?view=vs-2015), according to StackOverflow even since
2010 (see https://stackoverflow.com/questions/126279/c99-stdint-h
-header-and-ms-visual-studio). Not sure about clang.

Considering the fact that the 7.0 branch needs to support VxWorks 6 with
GCC 4.3 we can only implement this in 7.1 (assuming that we want to stay
away from implementing/maintaining these macros in EPICS Base).

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1740426

Title:
  portable printf() spec for size_t, long long, and others

Status in EPICS Base:
  Triaged

Bug description:
  I've been in the habit of using '%lld' and '%zu' to print 'long long'
  and 'size_t' respectively.  However, the windows world needs '%I64d'
  and '%Iu' instead.  It would be nice to have compatibility macros for
  this.

  stdint.h/inttypes.h has a convention for this for the standard fixed
  width types.  eg. PRIx32 for 'uint32_t'.  This is used like:

  > printf("%"PRIx32"\n", (uint32_t)42);

  http://en.cppreference.com/w/c/types/integer

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1740426/+subscriptions

Navigate by Date:
Prev: [Bug 1829919] Re: IOC segfaults when calling dbLoadRecords after iocInit Martin Konrad via Core-talk
Next: [Bug 1740426] Re: portable printf() spec for size_t, long long, and others rivers via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: [Bug 1829919] Re: IOC segfaults when calling dbLoadRecords after iocInit Andrew Johnson via Core-talk
Next: [Bug 1740426] Re: portable printf() spec for size_t, long long, and others rivers via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024