error: size of array is too large

Bug #1611876 reported by mdavidsaver
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Low
Andrew Johnson
3.14
Fix Released
Low
Andrew Johnson
3.15
Fix Released
Low
Andrew Johnson
3.16
Fix Released
Low
Andrew Johnson

Bug Description

GCC is smart enough to detect new[] with constant size which would always result in allocation failure. With GCC 6 this causes a compile failure in epicsExceptionTest.cpp.

http://www.aps.anl.gov/epics/tech-talk/2016/msg01113.php

https://github.com/epics-base/epics-base/issues/3

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

> /epicsExceptionTest.cpp: In function ‘void epicsExceptionTestPrivate()’:
> ../epicsExceptionTest.cpp:61:49: error: size of array is too large
> char * p = new char [unsuccessfulNewSize];
> ^
> ../epicsExceptionTest.cpp:74:38: error: size of array is too large
> char [unsuccessfulNewSize];
> ^

One workaround suggested by Bob Soliday is to remove the const from the definition of 'unsuccessfulNewSize', which will prevent GCC from making this check.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I see that epicsExceptionTest.cpp has already been removed from the 3.14 branch.

So the simplest workaround is to remove/comment the line

> TESTPROD_HOST += epicsExceptionTest

from src/libCom/test/Makefile

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.