EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: [Bug 1740426] Re: portable printf() spec for size_t, long long, and others
From: mdavidsaver via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Wed, 03 Aug 2022 13:58:43 -0000
** Description changed:

  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.
+ and 'size_t' respectively.
  
  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
+ 
+ edit 2022: As Mark points out, Windows supports %zu.  The remaining
+ holdout is vxWorks...

-- 
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.

  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

  edit 2022: As Mark points out, Windows supports %zu.  The remaining
  holdout is vxWorks...

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


Navigate by Date:
Prev: [Bug 1983385] Re: iocLogPrefix incompatible with VxWorks logMsg mdavidsaver via Core-talk
Next: [Bug 1983385] Re: iocLogPrefix incompatible with VxWorks logMsg Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: [Bug 1983472] Re: Format %z unknown to vxWorks Dirk Zimoch via Core-talk
Next: Build failed: epics-base base-smart-logClientPrefix-880 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·