Subject: |
[Bug 1740426] Re: portable printf() spec for size_t, long long, and others |
From: |
rivers via Core-talk <[email protected]> |
To: |
[email protected] |
Date: |
Tue, 07 Jan 2020 02:42:58 -0000 |
> 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.
I'm not sure I understand this comment. I have been using %lld and %llu
on Windows. I believe I tested and %z is supported on VS2015 and up,
but not on VS2010. But do we need to support VS2010 any more?
--
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 1740426] Re: portable printf() spec for size_t, long long, and others Martin Konrad via Core-talk
- Next:
EPICS 7, pvAccess & static build Torsten Bögershausen via Core-talk
- 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:
[Bug 1740426] Re: portable printf() spec for size_t, long long, and others Martin Konrad via Core-talk
- Next:
[Bug 1740426] Re: portable printf() spec for size_t, long long, and others Martin Konrad via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
|