Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to declare a const const-pointer?
How to declare a const const-pointer? [message #1808928] Thu, 04 July 2019 16:11 Go to next message
Martin Friedrich is currently offline Martin FriedrichFriend
Messages: 10
Registered: November 2015
Junior Member
Hi all,

I just stumbled over the (admittedly somewhat academic) topic of how does one declare a const pointer to a (non-)const type for C/C++, i.e. something like
char const* foo;

(Again, note that here the pointer is const, but not the data pointed to.) When generating code, I always end up with
const char* foo;

regardless of the order of the <Ptr>- and <Const>-stereotypes applied.

Regards,

Martin Friedrich

[Updated on: Thu, 04 July 2019 16:13]

Report message to a moderator

Re: How to declare a const const-pointer? [message #1808937 is a reply to message #1808928] Thu, 04 July 2019 17:26 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Dear Martin,

the code generator does not properly support this case - it does not take the order of the stereotype application into account. If you think that this is an important limitation, please post a bug.
A (quite ugly) is not to apply the <Const> stereotype and use the "declaration" attribute of the <Ptr> stereotype, i.e. assign the string "const*".

Ansgar
Re: How to declare a const const-pointer? [message #1809037 is a reply to message #1808937] Sat, 06 July 2019 18:20 Go to previous message
Martin Friedrich is currently offline Martin FriedrichFriend
Messages: 10
Registered: November 2015
Junior Member
Hi Ansgar,

thanks for your fast reply and the proposed workaround. I have sent a bug report to the papyrus-bugzilla.

I wonder if a similar issue exists for the volatile or mutable stereotypes?

Bye,

Martin
Previous Topic:Papyrus 4.4 is available
Next Topic:Change the way a property is shown into Model Explorer
Goto Forum:
  


Current Time: Fri Apr 26 09:20:02 GMT 2024

Powered by FUDForum. Page generated in 0.03003 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top