2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | sizeof with g++ > 5.2 |
From: | "Gofron, Kazimierz via Core-talk" <core-talk at aps.anl.gov> |
To: | "core-talk at aps.anl.gov" <core-talk at aps.anl.gov> |
Date: | Wed, 4 Mar 2020 18:22:01 +0000 |
Hi, Since base is written in C, and many drivers are written in C++, we are seeing some issues for string, as discussed below.
https://epics.anl.gov/tech-talk/2020/msg00515.php The g++ on Debian9 uses newer compiler than g++ > 5.2, and reports sizeof(string) up to 15. http://www.cplusplus.com/forum/beginner/173925/ sizeof(std::string), in-object space for small
string storage: ``` Is there a replacement / better way to use sizeof? mPollQueue(1, sizeof(acquisition_t)) Kazimierz Gofron NSLS-II Controls Group Brookhaven National Laboratory (p) +1 (631) 344 5283 (f) +1 (631) 344 8085 |