Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: do not try to encode or decode time_t and fix compiling warnings #10751

Merged
merged 6 commits into from Aug 19, 2016

Conversation

tchaikov
Copy link
Contributor

time_t is signed int on linux, which is ambiguous when encode() or decode() on i386-linux.
see also 8f9e7b0.

Signed-off-by: Kefu Chai kchai@redhat.com

time_t is `signed int` on linux, which is ambiguous when encode() or decode() on i386-linux.
see also 8f9e7b0.

Signed-off-by: Kefu Chai <kchai@redhat.com>
fixes the warning of
```
warning:
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-1566-ga98ddf7/src/objclass/objclass.h:35:72:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
6 has type ‘std::basic_string::size_type {aka unsigned int}’ [-Wformat=]
cls_log(level, " %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
^
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-1566-ga98ddf7/src/cls/rgw/cls_rgw.cc:477:7:
note: in expansion of macro ‘CLS_LOG’
CLS_LOG(20, "start_key=%s len=%lu", start_key.c_str(),
start_key.size());
^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
fix warnings like
```
comparison between signed and unsigned integer expressions
[-Wsign-compare]
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

silence warnings like
```
src/os/filestore/FileStore.h:55:27: comparison between signed and
unsigned integer expressions [-Wsign-compare]
^
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-1566-ga98ddf7/src/os/filestore/BtrfsFileStoreBackend.cc:269:29:
note: in expansion of macro ‘BTRFS_SUPER_MAGIC’
if (currentfs.f_type == BTRFS_SUPER_MAGIC && basest.st_dev != st.st_dev)
{
^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
silence warnings like:
```
src/test/librbd/fsx.cc:1589:21: comparison between signed and unsigned
integer expressions [-Wsign-compare]
(offset + size > monitorstart &&
^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
printf() a uint64 in a portable way (i.e. C98 compliant way).

Signed-off-by: Kefu Chai <kchai@redhat.com>
@@ -474,7 +474,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
decode_list_index_key(kiter->first, &key, &ver);

start_key = kiter->first;
CLS_LOG(20, "start_key=%s len=%lu", start_key.c_str(), start_key.size());
CLS_LOG(20, "start_key=%s len=%zu", start_key.c_str(), start_key.size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleasantly surprised to find this, and to find that it's also standard enough to be part of Solaris.

@dmick dmick merged commit 42a42c2 into master Aug 19, 2016
@dmick dmick deleted the wip-kefu-testing branch August 19, 2016 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants