wang-xinhong / protobuf

Automatically exported from code.google.com/p/protobuf
Other
0 stars 0 forks source link

Clang barks at file->options() != NULL #650

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With the ToT Clang the following warning is reported when I'm trying to build 
Chromium:

../../third_party/protobuf/src/google/protobuf/descriptor.cc -o 
obj/third_party/protobuf/src/google/protobuf/protobuf_full_do_not_use.descriptor
.o
../../third_party/protobuf/src/google/protobuf/descriptor.cc:4024:11: error: 
reference cannot be bound to dereferenced null pointer in well-defined C++ 
code; comparison may be assumed to always evaluate to true 
[-Werror,-Wtautological-undefined-compare]
         &file->options() != NULL &&
          ^~~~~~~~~~~~~~~    ~~~~
../../third_party/protobuf/src/google/protobuf/descriptor.h:1410:1: note: 
'options' returns a reference
PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions)
^
../../third_party/protobuf/src/google/protobuf/descriptor.h:1320:29: note: 
expanded from macro 'PROTOBUF_DEFINE_OPTIONS_ACCESSOR'
  inline const TYPE& CLASS::options() const { return *options_; }
                            ^
1 error generated.

This line is still present in the upstream protobuf: 
https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descr
iptor.cc#4025

Original issue reported on code.google.com by gli...@chromium.org on 30 Jun 2014 at 11:46

GoogleCodeExporter commented 9 years ago

Original comment by gli...@chromium.org on 30 Jun 2014 at 11:46

GoogleCodeExporter commented 9 years ago
The line this fires on has been deleted in the google-internal version of 
protobuf.

Original comment by thakis@chromium.org on 10 Jul 2014 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by jie...@google.com on 24 Jul 2014 at 5:46

GoogleCodeExporter commented 9 years ago

Original comment by jie...@google.com on 26 Aug 2014 at 3:20