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: Re: Compiler warning question
From: Chris Johns via Core-talk <core-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: EPICS Core Talk <core-talk at aps.anl.gov>, Michael Davidsaver <mdavidsaver at gmail.com>
Date: Thu, 17 Sep 2020 11:37:33 +1000
On 17/9/20 11:28 am, Mark Rivers wrote:
> That article is interesting but is about string truncation.  The warnings I am worried about are actually incorrectly flagging buffer overflow. I am hoping there is a cast or other method to avoid them.

OK, I am not across the full context. Reviewing the suggested patch the post
hinted that GCC looks for the terminating nul being written:

if (outStrings) {
 strncpy(&outStrings[i*MAX_ENUM_STRING_SIZE], inStrings[i], MAX_ENUM_STRING_SIZE);
 outStrings[i*MAX_ENUM_STRING_SIZE + MAX_ENUM_STRING_SIZE-1] = '\0';
}

> New string functions in base don’t really help me since asyn needs to build, preferably without such warnings, on older versions of base.

That makes things harder.

Chris

Replies:
Re: Compiler warning question Mark Rivers via Core-talk
References:
Compiler warning question Mark Rivers via Core-talk
Re: Compiler warning question Torsten Bögershausen via Core-talk
Re: Compiler warning question Ralph Lange via Core-talk
Re: Compiler warning question Michael Davidsaver via Core-talk
Re: Compiler warning question Chris Johns via Core-talk
Re: Compiler warning question Mark Rivers via Core-talk

Navigate by Date:
Prev: Re: Compiler warning question Mark Rivers via Core-talk
Next: Re: Compiler warning question Mark Rivers 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: Compiler warning question Mark Rivers via Core-talk
Next: Re: Compiler warning question Mark Rivers 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, 16 Sep 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·