Subject: |
fedora 25: epicsExceptionTest.cpp does not compile |
From: |
Marty Kraimer <[email protected]> |
To: |
"'EPICS core-talk'" <[email protected]> |
Date: |
Thu, 12 Jan 2017 06:22:40 -0500 |
I upgraded from fedora 23 to fedora25.
epics base builds except for src/libCom/test/epicsExceptionTest.cpp
It causes the following compiler error:
/usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_
-DUNIX -Dlinux -O3 -g -Wall -mtune=generic -m64 -I.
-I../O.Common -I. -I. -I.. -I../../../../include/compiler/gcc
-I../../../../include/os/Linux -I../../../../include -c
../epicsExceptionTest.cpp
../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];
^
../../../../configure/RULES_BUILD:228: recipe for target
'epicsExceptionTest.o' failed
This happens on both base-3.14.12.5 and base-3.16.0.1.
That test does not appear in base-3.15.5
Note that
mrk> g++ --version
g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
The code that causes the error is:
static void epicsExceptionTestPrivate ()
{
try {
char * p = new char [unsuccessfulNewSize];
testFail("new char[%lu] returned %p",
(unsigned long) unsuccessfulNewSize, p);
}
catch ( const bad_alloc & ) {
testPass("new char[%lu] threw",
(unsigned long) unsuccessfulNewSize);
}
catch ( ... ) {
testFail("new: threw wrong type");
}
try {
char * p = new ( nothrow )
char [unsuccessfulNewSize];
testOk(p == 0, "new (nothrow) returned %p", p);
}
catch( ... ) {
testFail("new (nothrow): threw");
}
}
In particular the statements:
char * p = new char [unsuccessfulNewSize];
and
char * p = new ( nothrow )
char [unsuccessfulNewSize];
It appears that the compiler now detects the problem instead of the
problem being detected at run time.
I commented out the code (thus test does not detect anything) and base
builds without error.
- Replies:
- Re: fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer
- Navigate by Date:
- Prev:
procServ 2.7.0-rc1 released Ralph Lange
- Next:
Re: fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: procServ 2.7.0-rc1 released Mark Rivers
- Next:
Re: fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024
|