https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003

Romain Geissler <romain.geissler at amadeus dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |romain.geissler at amadeus dot 
com

--- Comment #9 from Romain Geissler <romain.geissler at amadeus dot com> ---
Hi,

FYI, I tried to build rapidjson with the latest gcc 11, and I also see a lot of
Wnonnull warnings (which I think are false positives too) now. As rapidjson
seems to use -Werror by default, it breaks the build, I am going to remove this
-Werror to unblock me.

FYI, among the many warnings reported, you can see this one:

/workdir/src/rapidjson-1.1.0/include/rapidjson/schema.h:2104:93: error: 'this'
pointer null [-Werror=nonnull]

 2104 |     bool Bool(bool b)       { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool,  
(CurrentContext(), b), (b)); }

      |                                                                        
                    ^

/workdir/src/rapidjson-1.1.0/include/rapidjson/schema.h:2089:87: note: in
definition of macro 'RAPIDJSON_SCHEMA_HANDLE_PARALLEL_'

 2089 |                
static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\

      |                                                                        
              ^~~~

/workdir/src/rapidjson-1.1.0/include/rapidjson/schema.h:2104:31: note: in
expansion of macro 'RAPIDJSON_SCHEMA_HANDLE_VALUE_'

 2104 |     bool Bool(bool b)       { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool,  
(CurrentContext(), b), (b)); }

      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/workdir/src/rapidjson-1.1.0/include/rapidjson/schema.h:2104:10: note: in a
call to non-static member function 'bool
rapidjson::GenericSchemaValidator<SchemaDocumentType, OutputHandler,
StateAllocator>::Bool(bool) [with SchemaDocumentType =
rapidjson::GenericSchemaDocument<rapidjson::GenericValue<rapidjson::UTF8<> > >;
OutputHandler = rapidjson::BaseReaderHandler<rapidjson::UTF8<>, void>;
StateAllocator = rapidjson::CrtAllocator]'

 2104 |     bool Bool(bool b)       { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool,  
(CurrentContext(), b), (b)); }

      |          ^~~~


All the examples I checked were using the static_cast pattern similar to
comment #8.

Cheers,
Romain

Reply via email to