nonstandard c++ mutable ref in cac
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Medium
|
Jeff Hill |
Bug Description
the channel access client library source code uses some instances of mutable references and this is not allowed in standard c++, and is causing some issues with the new Clang compiler on Max OSX.
On Mar 11, 2011, at 9:27 PM, Jeff Hill wrote:
> Hi Tom,
>
> I wasn’t aware of that, and it probably needs to
> be fixed. The reference counting mutex class on the
> cvs trunk might be a clean workaround. Also, presumably
> the quick fix is to just use instead, a mutable
> _pointer_.
>
>
>> -----Original Message-----
>> From: Andrew Johnson
>> Sent: Friday, March 11, 2011 12:39 PM
>> To: Jeff Hill; EPICS core-talk
>> Cc: Pelaia II, Tom
>> Subject: Fwd: C++ compatibility
>>
>> Hi Jeff,
>>
>> An issue for you from the CA client library. Tom's right about the rule
>> (this
>> is not a recent change either, it's present in my 1998 first edition of
>> the
>> spec), but I have no idea why the restriction exists. I'm guessing that
>> Apple's clang C++ compiler has started to check this.
>>
>> Thanks Tom.
>>
>> - Andrew
>>
>> ---------- Forwarded Message ----------
>>
>> Subject: C++ compatibility
>> Date: Friday 11 March 2011
>> From: "Pelaia II, Tom"
>> To: Andrew Johnson
>>
>> Hi Andrew,
>>
>> I believe there is an error in some EPICS base source files in which
>> reference
>> members are declared mutable:
>>
>> In file included from ../cac.cpp:39:
>> ../cac.h:269:5: error: 'mutable' cannot be applied to references
>> mutable epicsMutex & mutex;
>> ^
>> ../cac.h:270:5: error: 'mutable' cannot be applied to references
>> mutable epicsMutex & cbMutex;
>> ^
>> In file included from ../cac.cpp:47:
>> ../udpiiu.h:152:5: error: 'mutable' cannot be applied to references
>> mutable epicsMutex & cbMutex;
>> ^
>> ../udpiiu.h:153:5: error: 'mutable' cannot be applied to references
>> mutable epicsMutex & cacMutex;
>> ^
>>
>>
>> The C++ specification (section 7.1.1 item 10) explicitly forbids mutable
>> reference members:
>> http://
>>
>> Best regards,
>> Tom
>> _______
>> Tom Pelaia | homepage: http://
>>
Related branches
tags: | added: ca cac |
tags: | added: clang osx |
summary: |
- nonstandard c++ const ref in cac + nonstandard c++ mutable ref in cac |
Changed in epics-base: | |
assignee: | nobody → Jeff Hill (johill-lanl) |
importance: | Undecided → Low |
status: | New → Confirmed |
tags: | added: 15 fedora |
Changed in epics-base: | |
importance: | Low → Medium |
milestone: | none → 3.14.branch |
Changed in epics-base: | |
status: | Confirmed → Fix Committed |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
Another user has noticed this issue
Hello.
I've tried building EPICS base on the latest Fedora 15.
First problem I encountered was
In file included from ../../. ./src/libCom/ cxxTemplates/ epicsOnce. cpp:29: 0: ./src/libCom/ cxxTemplates/ epicsSingleton. h:37:5: error: ‘size_t’
../../.
does not name a type
My fix for that was to include
EPICS_BASE/ src/libCom/ cxxTemplates/ epicsSingleton. h
#include "stddef.h"
in the file
Next problem while compiling epics base is
In file included from ../cac.cpp:39:0:
../cac.h:269:26: error: reference ‘mutex’ cannot be declared ‘mutable’
[-fpermissive]
../cac.h:270:26: error: reference ‘cbMutex’ cannot be declared ‘mutable’
[-fpermissive]
In file included from ../cac.cpp:47:0:
../udpiiu.h:152:26: error: reference ‘cbMutex’ cannot be declared
‘mutable’ [-fpermissive]
../udpiiu.h:153:26: error: reference ‘cacMutex’ cannot be declared
‘mutable’ [-fpermissive]
make[3]: *** [cac.o] Error 1
I think that this thread is referring to the same problem. www.aps. anl.gov/ epics/core- talk/2011/ msg00029. php
http://
Any suggestion how to resolve that 'mutable' compilation issue?
Thanks.
Miroslav
--
Miroslav Mihaylov
<email address hidden>