Subject: |
Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base |
From: |
Andrew Johnson <[email protected]> |
To: |
mdavidsaver <[email protected]> |
Date: |
Thu, 10 Jul 2014 23:00:48 -0000 |
On 07/10/2014 05:14 PM, mdavidsaver wrote:
>> In dbUnitTest.c shouldn't the Type arguments to OP use the
>> epics{Int,UInt,Float}<n> names? If not I suspect there
>> should at least be a couple more 'unsigned' keywords in
>> there.
>
> Before I can answer this question I think you will need to
> educate me a bit about argument type promotion in vararg
> functions. Does va_arg() have knowledge of this? Will
> va_arg(X,short) actually return an 'int'?
No, you just educated me, I withdraw the above comment. It would be nice
to have a source-file comment nearby saying something like "See the C
integer type promotion rules" for human readers, and maybe use that
language in the header file as well.
> Just to throw out another idea. I have considered using
> printf style syntax just to get a compile time check. eg.
> testdbPutField("pvname", DBF_LONG, "%d", 0) where exactly
> "%d" must be used for DBF_LONG. As a side effect this
> would work well for DBF_STRING.
True, but it might cause problems on Windows when we add 64-bit integer
fields ("%ld" vs "%lld"). I'm about to publish a branch for comments
that introduces DBF_INT64 and DBF_UINT64 types to the database.
Unfortunately it will probably break device support for waveform and
other record types that can choose field types, because I inserted the
64-bit type IDs between ULONG and FLOAT.
- Andrew
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
https://code.launchpad.net/~epics-core/epics-base/ioc-shutdown2/+merge/224213
Your team EPICS Core Developers is subscribed to branch lp:epics-base.
- References:
- Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base mdavidsaver
- Navigate by Date:
- Prev:
Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base mdavidsaver
- Next:
Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base Andrew Johnson
- 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:
Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base mdavidsaver
- Next:
Re: [Merge] lp:~epics-core/epics-base/ioc-shutdown2 into lp:epics-base mdavidsaver
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|