antlr4 // cpp runtime // codecvt

116 views
Skip to first unread message

Sergei Nikulov

unread,
Mar 9, 2017, 7:54:42 AM3/9/17
to antlr-discussion
Hello all,

Just wonder, is it possible to lower required version for Cpp runtime (Linux/g++)?

Current implementation have dependency on <codecvt> header which appears in g++ version 5 and higher.
While some enterprise Linux distributions and embedded SDK still using 4.8 or lower.

Is it possible to reduce dependency from codecvt either by disabling it or by using boost::locale as replacement?

Thank you.

Regards,
Sergei Nikulov

Mike Lischke

unread,
Mar 9, 2017, 8:19:52 AM3/9/17
to antlr-di...@googlegroups.com
Hi Sergei,

> Just wonder, is it possible to lower required version for Cpp runtime (Linux/g++)?

You are free to adjust the code to your needs, but for the official distribution we should sensitively use what is available.

>
> Current implementation have dependency on <codecvt> header which appears in g++ version 5 and higher.

> While some enterprise Linux distributions and embedded SDK still using 4.8 or lower.

My standpoint is that some special cases should not limit the majority of the users. C++11 is here since years and is fully supported by all relevant compilers. If some distros prefer to stay with old compilers which cannot cope with today's code then they simply cannot use today's code (or need adjustments).

>
> Is it possible to reduce dependency from codecvt either by disabling it or by using boost::locale as replacement?

We would force boost on all users, which is a pain. But you could take the source code, remove the codecvt part and provide your own conversion routine (e.g. using boost). It's open source after all :-)

Mike
--
www.soft-gems.net

Sergei Nikulov

unread,
Mar 9, 2017, 9:53:57 AM3/9/17
to antlr-discussion


четверг, 9 марта 2017 г., 16:19:52 UTC+3 пользователь Mike Lischke написал:
Thank you. I understand your point. 

Currently, antlr4 uses feature std::wstring_convert which appears to be deprecated in C++17 (ref. http://en.cppreference.com/w/cpp/locale).

So anyway, we should think about it :) 

Either to remove it or make it conditional or use something that is stable enough (boost?).
I believe adding boost is not that hard with CMake help.
 

Mike
--
www.soft-gems.net

Mike Lischke

unread,
Mar 10, 2017, 11:49:09 AM3/10/17
to antlr-di...@googlegroups.com
Hi Sergei,

Currently, antlr4 uses feature std::wstring_convert which appears to be deprecated in C++17 (ref. http://en.cppreference.com/w/cpp/locale).

So anyway, we should think about it :) 

Oh, that's a good point. I didn't know this is deprecated. Any idea what's recommended instead? Have to dig a bit...


Either to remove it or make it conditional or use something that is stable enough (boost?).
I believe adding boost is not that hard with CMake help.

Ok, create a pull request for that and we discuss it. Should be so that a parameter for cmake decides what to use for codecvt, C++11 or boost. Should have the least impact for anybody else not interested in that.


Reply all
Reply to author
Forward
0 new messages