So is there a decision for this issue? Will it be a flag for protoc or
a patch (I think I saw somewhere a post mentioning that the patch was
not going to be used because of other issues)? And any possible ETA
for the solution?



On Aug 31, 5:33 pm, Kenton Varda <ken...@google.com> wrote:
> I'm OK with a patch that just adds the call to Message().
> I'm not OK with a patch that explicitly initializes every single field,
> which is what Michael is talking about, since it conflicts with an
> optimization we did to reduce code size.  I'd also rather not add an option
> for this because it would be tedious to maintain and test and we have too
> many options already.
>
> On Mon, Aug 31, 2009 at 5:17 PM, Michael Poole <mdpo...@troilus.org> wrote:
>
> > Joshua  Haberman writes:
>
> > > The protobuf library compiled and installed fine, but the generated
> > > classes threw warnings (and since I was compiling with -Werror, failed
> > > to compile).  The warning was:
>
> > > benchmarks/google_messages.pb.cc: In copy constructor
> > > ‘benchmarks::SpeedMessage2::SpeedMessage2(const
> > > benchmarks::SpeedMessage2&)’:
> > > benchmarks/google_messages.pb.cc:4179: warning: base class ‘class
> > > google::protobuf::Message’ should be explicitly initialized in the
> > > copy constructor
>
> > > I thought this was an odd warning, since the constructors don't
> > > explicitly initialize their base classes, and do not throw warnings.
> > > I also thought it was odd since other versions of gcc don't throw this
> > > warning AFAIK.
>
> > This warning is triggered by using g++'s -Weffc++ warning flag.  I
> > raised this before[1], with a patch that was backed out because it led
> > to constructor code being duplicated.
>
> > Making both sides happy probably involves adding a command-line flag
> > to protoc that toggles how it generates code: by default, omitting
> > those constructor calls, but allowing the user to ask for those
> > constructors to be called.
>
> > Kenton, would that be a reasonable approach?  If so, I should have
> > time to update my patch to do that and resubmit.
>
> > [1]http://code.google.com/p/protobuf/issues/detail?id=86
>
> > Michael Poole
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to