[protobuf] Re: Exporting Proto Classes from Shared Libraries

2012-02-15 Thread Alexander Pensky
The problem is the way the static initializers work.  If you export the 
classes from a .pb.cc file as part of a shared library (.so), their 
initializers will run every time you load the .so.   But these initializers 
need to add entries to tables which are in libprotobuf.so, and the same 
descriptor cannot be added twice.   So, anything that causes your message 
class .so to be loaded more times than the main protobuf .so is going to 
abort on a GOOGLE_CHECK at runtime.   For example, unloading and reloading 
the .so with dlopen(), or loading more than one .so module which has the 
message .so as a dependency.

(Note this is not an issue with Windows .DLL modules.)

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/LNpUy4oF19QJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 361 in protobuf: Fix warnings

2012-02-15 Thread protobuf


Comment #8 on issue 361 by van...@gmail.com: Fix warnings
http://code.google.com/p/protobuf/issues/detail?id=361

I've fixed all warnings in protobuf itself, only warnings for unittests  
left:


google/protobuf/compiler/cpp/cpp_unittest.cc:878:5: ошибка: case value  
«12589235» not in enumerated type «protobuf_unittest::TestSparseEnum»  
[-Werror=switch]



--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 361 in protobuf: Fix warnings

2012-02-15 Thread protobuf


Comment #9 on issue 361 by van...@gmail.com: Fix warnings
http://code.google.com/p/protobuf/issues/detail?id=361

This patch is for protobuf version 2.4.1

There several types of warnings left: unused-variable, conversion-null,  
overflow, switch


All signed versus unsinged warnings fixed (using explicit static_cast).

Attachments:
fix_warnings_2.4.1.patch  151 KB

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.