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 1983472] Re: Format %z unknown to vxWorks
From: Dirk Zimoch via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Wed, 03 Aug 2022 12:29:17 -0000
** Description changed:

  VxWorks even in version 6.9 does not know the printf format specifier
  %z. It will instead print a literal z (and shift all arguments to the
- next format o course).
+ next format of course).
  
  This is related to bug #1740426 but not exactly the same.
  
  Affected code in EPICS 7 (as found by grep %z):
  
  modules/pvData/src/factory/FieldCreateFactory.cpp:    sprintf(buffer, "%s<%zu>", ScalarTypeFunc::name(getElementType()), size);
  modules/pvData/src/factory/FieldCreateFactory.cpp:    sprintf(buffer, "%s[%zu]", ScalarTypeFunc::name(getElementType()), size);
  modules/pvData/testApp/pv/testPVData.cpp:#define SHOW(T) testDiag("sizeof(" #T ")==%zu", sizeof(T))
  modules/pvData/testApp/pv/performstruct.cpp:        printf("# %zu sample   %f +- %f %s\n", count, mean/mult, std/mult, unit);
  modules/pvData/testApp/pv/performstruct.cpp:        sprintf(buf, "field%zu", i);
  modules/pvAccess/pvtoolsSrc/pvlist.cpp:            "Broadcast address #%zu: %s.", i, inetAddressToString(broadcastAddresses[i]).c_str());
  modules/pvAccess/pvtoolsSrc/pvlist.cpp:            LOG(logLevelDebug, "UDP Tx (%zu) -> %s", sendBuffer.getPosition(), strBuffer);
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:        LOG(logLevelDebug, "UDP Tx (%zu) %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:        LOG(logLevelDebug, "Sending %zu bytes %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:            LOG(logLevelDebug, "Sending %zu bytes %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:                "Broadcast address #%zu: %s. (%sunicast)", i, inetAddressToString(list[i]).c_str(),
  modules/pvAccess/src/remote/transportRegistry.cpp:    LOG(logLevelDebug, "Context still has %zu transport(s) active and closing...", temp.size());
  modules/pvAccess/src/remote/codec.cpp:            "Transport to %s still has %zu channel(s) active and closing...",
  modules/pvAccess/src/remote/codec.cpp:                "Transport to %s still has %zu client(s) active and closing...",
  modules/pvAccess/src/server/responseHandlers.cpp:                    LOG(logLevelError, "Monitor Logic Error: send outside of window %zu", _window_closed.size());
  modules/pvAccess/src/ioc/reftrackioc.cpp:            printf(" %s : %zu (delta %zd)\n",
  modules/pvAccess/src/ioc/reftrackioc.cpp:            printf(" %s : %zu\n", it->first.c_str(), it->second.current);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:        testDiag("Spamming %zu", nfree);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:            testDiag("nfree=%zu %c", nfree, (nfree>0)?'T':'F');
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:        testDiag("Spamming %zu", nfree);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:            testDiag("Count %d nfree=%zu %c", c, nfree, (nfree>0)?'T':'F');
  modules/pvAccess/testApp/remote/testChannelConnect.cpp:                sprintf(buf, "test%zu", (i+1));
  modules/pva2pva/pdbApp/pdbgroup.cpp:    printf("  Atomic Get/Put:%s Monitor:%s Members:%zu\n",
  modules/pva2pva/pdbApp/pvalink_jlif.cpp:                printf(" #disconn=%zu prov=%s", pval->lchan->num_disconnect, pval->lchan->providerName.c_str());
  modules/pva2pva/pdbApp/pvalink.cpp:            fprintf(stderr, "pvaLink leaves %zu channels open\n",
  modules/pva2pva/pdbApp/pvalink.cpp:                printf("conn=%c %zu disconnects, %zu type changes",
  modules/pva2pva/pdbApp/pvalink.cpp:        printf("  %zu/%zu channels connected used by %zu links\n",
  modules/pva2pva/testApp/testpdb.cpp:            testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
  modules/pva2pva/testApp/testpdb.cpp:            testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
  modules/libcom/test/epicsErrlogTest.c:    testOk(pvt.count >= N && pvt.count<=N+2, "Logged %u messages, expected %zu", pvt.count, N+1);
  modules/libcom/test/yajl_test.c:                fprintf(stderr, "%zu is an invalid buffer size\n",
  modules/libcom/test/yajl_test.c:                "failed to allocate read buffer of %zu bytes, exiting.",

-- 
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/1983472

Title:
  Format %z unknown to vxWorks

Status in EPICS Base:
  New

Bug description:
  VxWorks even in version 6.9 does not know the printf format specifier
  %z. It will instead print a literal z (and shift all arguments to the
  next format of course).

  This is related to bug #1740426 but not exactly the same.

  Affected code in EPICS 7 (as found by grep %z):

  modules/pvData/src/factory/FieldCreateFactory.cpp:    sprintf(buffer, "%s<%zu>", ScalarTypeFunc::name(getElementType()), size);
  modules/pvData/src/factory/FieldCreateFactory.cpp:    sprintf(buffer, "%s[%zu]", ScalarTypeFunc::name(getElementType()), size);
  modules/pvData/testApp/pv/testPVData.cpp:#define SHOW(T) testDiag("sizeof(" #T ")==%zu", sizeof(T))
  modules/pvData/testApp/pv/performstruct.cpp:        printf("# %zu sample   %f +- %f %s\n", count, mean/mult, std/mult, unit);
  modules/pvData/testApp/pv/performstruct.cpp:        sprintf(buf, "field%zu", i);
  modules/pvAccess/pvtoolsSrc/pvlist.cpp:            "Broadcast address #%zu: %s.", i, inetAddressToString(broadcastAddresses[i]).c_str());
  modules/pvAccess/pvtoolsSrc/pvlist.cpp:            LOG(logLevelDebug, "UDP Tx (%zu) -> %s", sendBuffer.getPosition(), strBuffer);
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:        LOG(logLevelDebug, "UDP Tx (%zu) %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:        LOG(logLevelDebug, "Sending %zu bytes %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:            LOG(logLevelDebug, "Sending %zu bytes %s -> %s.",
  modules/pvAccess/src/remote/blockingUDPTransport.cpp:                "Broadcast address #%zu: %s. (%sunicast)", i, inetAddressToString(list[i]).c_str(),
  modules/pvAccess/src/remote/transportRegistry.cpp:    LOG(logLevelDebug, "Context still has %zu transport(s) active and closing...", temp.size());
  modules/pvAccess/src/remote/codec.cpp:            "Transport to %s still has %zu channel(s) active and closing...",
  modules/pvAccess/src/remote/codec.cpp:                "Transport to %s still has %zu client(s) active and closing...",
  modules/pvAccess/src/server/responseHandlers.cpp:                    LOG(logLevelError, "Monitor Logic Error: send outside of window %zu", _window_closed.size());
  modules/pvAccess/src/ioc/reftrackioc.cpp:            printf(" %s : %zu (delta %zd)\n",
  modules/pvAccess/src/ioc/reftrackioc.cpp:            printf(" %s : %zu\n", it->first.c_str(), it->second.current);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:        testDiag("Spamming %zu", nfree);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:            testDiag("nfree=%zu %c", nfree, (nfree>0)?'T':'F');
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:        testDiag("Spamming %zu", nfree);
  modules/pvAccess/testApp/remote/testmonitorfifo.cpp:            testDiag("Count %d nfree=%zu %c", c, nfree, (nfree>0)?'T':'F');
  modules/pvAccess/testApp/remote/testChannelConnect.cpp:                sprintf(buf, "test%zu", (i+1));
  modules/pva2pva/pdbApp/pdbgroup.cpp:    printf("  Atomic Get/Put:%s Monitor:%s Members:%zu\n",
  modules/pva2pva/pdbApp/pvalink_jlif.cpp:                printf(" #disconn=%zu prov=%s", pval->lchan->num_disconnect, pval->lchan->providerName.c_str());
  modules/pva2pva/pdbApp/pvalink.cpp:            fprintf(stderr, "pvaLink leaves %zu channels open\n",
  modules/pva2pva/pdbApp/pvalink.cpp:                printf("conn=%c %zu disconnects, %zu type changes",
  modules/pva2pva/pdbApp/pvalink.cpp:        printf("  %zu/%zu channels connected used by %zu links\n",
  modules/pva2pva/testApp/testpdb.cpp:            testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
  modules/pva2pva/testApp/testpdb.cpp:            testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
  modules/libcom/test/epicsErrlogTest.c:    testOk(pvt.count >= N && pvt.count<=N+2, "Logged %u messages, expected %zu", pvt.count, N+1);
  modules/libcom/test/yajl_test.c:                fprintf(stderr, "%zu is an invalid buffer size\n",
  modules/libcom/test/yajl_test.c:                "failed to allocate read buffer of %zu bytes, exiting.",

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


References:
[Bug 1983472] [NEW] Format %z unknown to vxWorks Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 1983472] [NEW] Format %z unknown to vxWorks Dirk Zimoch 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] [NEW] Format %z unknown to vxWorks Dirk Zimoch via Core-talk
Next: [Bug 1740426] Re: portable printf() spec for size_t, long long, and others mdavidsaver 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 ·