-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.18.0-alpha
-
Component/s: uri
-
None
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.
- is related to
-
CDRIVER-3850 Allow timeoutMS to be set via the URI
- Closed