-
Type: Improvement
-
Resolution: Gone away
-
Priority: Trivial - P5
-
None
-
Affects Version/s: 1.17.3
-
Component/s: libbson
-
None
-
Environment:Ubuntu 20.04(GCC 9.3)
#include <bson/bson.h> int main() { return 0; }
compile with option -pipe -Wall -pedantic -Wextra -Wconversion -Wformat=1 -Wno-unused-parameter
In file included from /usr/local/include/libbson-1.0/bson/bson-types.h:30, from /usr/local/include/libbson-1.0/bson/bson-context.h:25, from /usr/local/include/libbson-1.0/bson/bson.h:31, from Documents/code/test_cmake/main.cpp:1: /usr/local/include/libbson-1.0/bson/bson-endian.h: In function ‘uint16_t __bson_uint16_swap_slow(uint16_t)’: /usr/local/include/libbson-1.0/bson/bson-endian.h:136:31: warning: conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Wconversion] 136 | return ((v & 0x00FF) << 8) | ((v & 0xFF00) >> 8); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/libbson-1.0/bson/bson.h:40, from Documents/code/test_cmake/main.cpp:1: /usr/local/include/libbson-1.0/bson/bson-oid.h: In function ‘void bson_oid_init_from_string_unsafe(bson_oid_t*, const char*)’: /usr/local/include/libbson-1.0/bson/bson-oid.h:217:68: warning: conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} may change value [-Wconversion] 217 | oid->bytes[i] = ((bson_oid_parse_hex_char (str[2 * i]) << 4) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 218 | (bson_oid_parse_hex_char (str[2 * i + 1]))); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- is related to
-
CDRIVER-3632 Fix unresolved pedantic warnings
- Closed