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 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: fedora 25: epicsExceptionTest.cpp does not compile
From: Marty Kraimer <mrkraimer@comcast.net>
To: core-talk@aps.anl.gov
Date: Thu, 12 Jan 2017 08:40:29 -0500
I just downloaded base-3.14.12.6 and I see that epicsExceptionTest is no longer present.
It builds just fine on fedora 25.

Marty


On 01/12/2017 06:22 AM, Marty Kraimer wrote:
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.









References:
fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer

Navigate by Date:
Prev: fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer
Next: RE: procServ 2.7.0-rc1 released Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: fedora 25: epicsExceptionTest.cpp does not compile Marty Kraimer
Next: Concerns about link-support-2 branch Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 13 Jan 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·