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  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  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:
```
GNU libstdc++ (conforming implementation, GCC 5.2 or later): 32, 15
LLVM libc++: 24, 22
Microsoft msc++ 19.00 (VS 2015): 28, 15

```

 

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

(e) kgofron at bnl.gov

(w) www.bnl.gov/nsls2

 


Replies:
Re: sizeof with g++ > 5.2 Michael Davidsaver via Core-talk

Navigate by Date:
Prev: Re: Mailing lists of old SourceForge "V4" project Johnson, Andrew N. via Core-talk
Next: Re: sizeof with g++ > 5.2 Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] Re: Mailing lists of old SourceForge "V4" project Kasemir, Kay via Core-talk
Next: Re: sizeof with g++ > 5.2 Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 09 Mar 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·