C++ support coming

197 views
Skip to first unread message

Samy Al Bahra

unread,
Aug 8, 2014, 5:36:07 PM8/8/14
to concurr...@googlegroups.com

Seems a lot of people want C++ compatibility now. So, we will slowly be C89ing things.

Samy Al Bahra

unread,
Aug 8, 2014, 5:37:18 PM8/8/14
to concurr...@googlegroups.com

If anyone has issues with this, please let me know.

Devon H. O'Dell

unread,
Aug 8, 2014, 7:01:20 PM8/8/14
to concurr...@googlegroups.com
Ugh. Why not just #ifdef __cplusplus extern "C"? Or are there still
compilers that hate 15 year old standards that much?
> --
> You received this message because you are subscribed to the Google Groups
> "Concurrency Kit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to concurrencyki...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Samy Al Bahra

unread,
Aug 8, 2014, 7:13:15 PM8/8/14
to concurr...@googlegroups.com
C++ only supports C89.
--
Samy Al Bahra [http://repnop.org]

Devon H. O'Dell

unread,
Aug 8, 2014, 8:09:30 PM8/8/14
to concurr...@googlegroups.com
*cringe*

Jed Brown

unread,
Aug 9, 2014, 9:41:03 AM8/9/14
to Samy Al Bahra, concurr...@googlegroups.com
Samy Al Bahra <sba...@repnop.org> writes:

> C++ only supports C89.

What do these C++ devotees think of C++11 (which includes some post-C89
features)?

Samy Al Bahra

unread,
Aug 9, 2014, 12:15:48 PM8/9/14
to Jed Brown, concurr...@googlegroups.com
Unfortunately, the features we use such as FAMs, don't appear to be
supported. However, we can use GNU89 features such as 0-sized arrays
as a replacement.

Devon H. O'Dell

unread,
Aug 9, 2014, 12:21:12 PM8/9/14
to concurr...@googlegroups.com, Jed Brown
So we aim to target GCC only?

Samy Al Bahra

unread,
Aug 9, 2014, 12:22:54 PM8/9/14
to concurr...@googlegroups.com, Jed Brown
No. This is a feature supported by all our supported compilers in one
form or another.

Devon H. O'Dell

unread,
Aug 9, 2014, 12:47:50 PM8/9/14
to concurr...@googlegroups.com, Jed Brown
I'm not convinced that changing the code in a way that affects the
style, reduces language features (that are used), forces us back to a
25-year-old language specification, just so we can share code with an
entirely different language is worth it. It reduces the overhead of
making a C++ package, but it doesn't guarantee the API will be any
good (which is IMO the most important thing to consider). Indeed, one
huge reason CK is great is because it has a great API. I'm not in
favor of anything that would change the API (and make me have to
revert to C89-isms in my own C99 code consuming CK). I'm doubly not in
favor if such a change is only for getting stuff out the door quicker.

I am not a C++ programmer and I really doubt I ever will be one at
this point. At least not a good one. I don't know the idioms and I
don't really care to learn them. So such a change increases the
complexity of contributing to CK. All of a sudden, I need to know how
my C code affects people targeting C++ (because I'm sure that it's a
little more involved than simply switching to C89). I also don't know
idiomatic C++. If I am to contribute more, I really need to not be
able to screw up anything about the C++ code or its API.

Of course it's primarily your project and I've contributed very little
in terms of code compared to you and other contributors, so I realize
I have very little to say here. Up to you. I'd prefer to not sacrifice
readability and used features just to reduce effort to port the
functionality to an entirely different language. I feel like the best
way to do this is to provide separate C++ implementation. It is within
the goals of the project, and it provides precedence to allowing other
contributors to make idiomatic ports for other languages as well.

--dho

Sameer Kumar

unread,
Aug 9, 2014, 10:30:06 PM8/9/14
to concurr...@googlegroups.com, Jed Brown
Except for adding few casts in ck_pr.h ( I remember 4 or 6 casts from void* to something else ), the current concurrency kit lib works just fine with C++.
Hence curious, what is it about ?

Doug Moore

unread,
Jan 7, 2017, 12:24:36 AM1/7/17
to Concurrency Kit
It seems to remain undone.  For example, ck_spinlock_mcs_lock needs a pointer cast that would let C++ compilers handle the code without hurting C compilers.  Might such changes be forthcoming?

Doug Moore

unread,
Jan 10, 2017, 6:21:56 PM1/10/17
to Concurrency Kit
Okay, I've done it.  I just don't know who to give it to or how to give it to them.  Basically, there are pointer casts to add and a couple of empty arrays to work around, and then I can include all the ck headers in a C++ module without complaint.  Anybody out there?

Devon H. O'Dell

unread,
Jan 13, 2017, 12:08:19 PM1/13/17
to concurr...@googlegroups.com
Are you familiar with git / github? You can create a pull request
against https://github.com/concurrencykit/ck, which can be reviewed
and merged. If you need any help here, feel free to reach out to me
off-list and I'd be happy to assist.

--dho

Doug Moore

unread,
Jan 14, 2017, 6:57:09 AM1/14/17
to Concurrency Kit
About 3 days into learning git/github.  I've created the pull request already.  Thanks.

Doug Moore

unread,
Jan 14, 2017, 9:40:30 PM1/14/17
to Concurrency Kit
The pull request has been rejected, and concurrencykit/ck won't support C++, ever.  You can find my adaptations at https://github.com/unkadoug/ck if you want them.
Reply all
Reply to author
Forward
0 new messages