What version of protobuf builds with -std=c++98 or -std=c++03?

116 views
Skip to first unread message

Simon Elliott

unread,
Jul 4, 2019, 10:25:59 AM7/4/19
to Protocol Buffers
In https://github.com/protocolbuffers/protobuf/issues/2780 it's suggested that "We may create a branch that works for C++98. The branch will only accept bug fixes, but not new features, optimization, etc"

https://github.com/protocolbuffers/protobuf/issues/3492 "Code should compile with --std=c++03 before we switch to c++11 only" has been closed, but I can't find the corresponding commit.

I've tried to build  a few versions but always fall foul of "error: use of undeclared identifier 'va_copy'" which as c++ developers will be aware is specific to c++11 and later.

Can anyone advise which version builds with -std=c++98 or -std=c++03?

Adam Cozzette

unread,
Jul 8, 2019, 6:05:53 PM7/8/19
to Simon Elliott, Protocol Buffers
The 3.5.x branch contains the most recent code that still builds without requiring C++11.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/986b414f-53ca-480f-8b4b-510ae70786aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Elliott

unread,
Jul 10, 2019, 6:16:21 AM7/10/19
to Protocol Buffers
On Monday, July 8, 2019 at 11:05:53 PM UTC+1, Adam Cozzette wrote:
The 3.5.x branch contains the most recent code that still builds without requiring C++11.

I've tried 3.5.1 and 3.5.2 and both require va_copy which is C++11 and later.

Adam Cozzette

unread,
Jul 10, 2019, 12:13:20 PM7/10/19
to Simon Elliott, Protocol Buffers
That's interesting, I didn't realize we were already relying on that in 3.5 and that it was C++11. If you need to get rid of that, feel free to send a pull request against the 3.5.x branch.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.

Mike Pentney

unread,
Aug 12, 2019, 9:11:45 AM8/12/19
to Protocol Buffers
Hi, Simon.

I am using protobuffers with Visual Studio 2008; I went for version 2.6.1 which is tagged in the git repository. From what I could gather, any version above 3.0 requires C++11...

HTH,

Mike.

Adam Cozzette

unread,
Aug 12, 2019, 12:37:07 PM8/12/19
to Mike Pentney, Protocol Buffers
Before version 3.5, we had tests verifying that all the code would still build with GCC using C++98. Maybe GCC inadvertently enabled a few C++11 features even in C++98 mode, but I think for the most part we avoided any C++11 features until 3.5.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.

Zippy

unread,
Aug 12, 2019, 3:12:15 PM8/12/19
to Adam Cozzette, Mike Pentney, Protocol Buffers
Simon: I was able to compile the latest patch revision of 3.5.2 in C++03 mode on GCC and MSVC without modifying the src.

All: ... but Solaris Studio and the AIX XL compiler are no bueno because of some template metaprogramming constructs which may or may not be part of the C++03 spec itself. I didn't save the errors because I tried both 3 months ago and gave up trying to work around the errors, as too many classes in a couple of headers had the same error (part of the error was template specialization IIRC).

I suspect I'm the only one here who has any interest in compiling on XL and Solaris Studio (needed to link with other libs built using the same compiler), but if not I can try again and attach compilation error output.

Reply all
Reply to author
Forward
0 new messages