|
I observed the following -Wformat compiler warning due to _mongoc_uri_set_option_as_int64_with_error using %lld for int64_t:
/home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-uri.c: In function ‘_mongoc_uri_set_option_as_int64_with_error’:
|
/home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-uri.c:2854:10: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘int64_t’ {aka ‘long int’} [-Wformat=]
|
2854 | "Invalid \"%s\" of %lld: must be a non-negative integer",
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2855 | option_orig,
|
2856 | value);
|
| ~~~~~
|
| |
|
| int64_t {aka long int}
|
/home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-uri.c:61:20: note: in definition of macro ‘MONGOC_URI_ERROR’
|
61 | format, \
|
| ^~~~~~
|
/home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-uri.c:2854:32: note: format string is defined here
|
2854 | "Invalid \"%s\" of %lld: must be a non-negative integer",
|
| ~~~^
|
| |
|
| long long int
|
| %ld
|
For portability, it would be preferable to use the PRId64 constant instead.
|