--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
$ protobuf-3.1/bin/protoc --cpp_out=. demo.proto
$ /usr/bin/g++ -Iprotobuf-3.1/include -c -Wall -O2 -Wno-long-long demo.pb.cc -o demo.pb.o
In member function 'virtual bool demo::DemoMessage::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
cc1plus: warning: dereferencing pointer 'prephitmp.1630' does break strict-aliasing rules
demo.pb.h:266: note: initialized from here
cc1plus: note: initialized from hereWhat version of g++ are you using? Also, do you have a way of determining what actual line of code the compiler is warning about there?I tried building with -Wstrict-aliasing=2 at commit df8390790a and saw a few warnings like this:./google/protobuf/generated_message_util.h:94:66: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]const T& get() const { return reinterpret_cast<const T&>(union_); }But that doesn't look like it's quite the same warning as what you are seeing.
On Fri, Nov 11, 2016 at 12:39 PM, <changchun...@gmail.com> wrote:
I have below option in my .proto file:option cc_enable_arenas = true;But g++ for Linux gives below warning:cc1plus: warning: dereferencing pointer 'prephitmp.4925' does break strict-aliasing rulesWill this cause issue and how to solve it?
--
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 unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.$ uname -a
Linux demo-host 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
262 inline ::std::string* DemoMessage::mutable_first() {
263 if (!has_first()) {
264 clear_msg_data();
265 set_has_first();
266 msg_data_.first_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
267 }
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
Thank you, Adam, if it’s confirmed just matter of warning no harm, then I can live with it for now. Once I can upgrade the compiler, then as you tested, it should go away.
Regards,
----
Changchun Zhao | Software Engineer
Transaction Network Services
10740 Parkridge Blvd | Suite 100 | Reston | VA | 20191 | USA
O: +1 703 667 4674 | M: +1 240 535 2615 | E: cz...@tnsi.com | www.tnsi.com
One Connection – A World of Opportunities