[GH-ISSUE #47] -Wsign-compare make Warning #30

Closed
opened 2026-03-04 01:41:19 +03:00 by kerem · 3 comments
Owner

Originally created by @pajarom on GitHub (Jul 12, 2014).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/47

g++ -DPACKAGE_NAME="s3fs" -DPACKAGE_TARNAME="s3fs" -DPACKAGE_VERSION="1.77" -DPACKAGE_STRING="s3fs\ 1.77" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="s3fs" -DVERSION="1.77" -DHAVE_MALLOC_TRIM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp
fdcache.cpp: In member function ‘int FdEntity::Load(off_t, off_t)’:
fdcache.cpp:800:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if((*iter)->bytes >= (2 * S3fsCurl::GetMultipartSize()) && !nomultipart){ // default 20MB

Originally created by @pajarom on GitHub (Jul 12, 2014). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/47 g++ -DPACKAGE_NAME=\"s3fs\" -DPACKAGE_TARNAME=\"s3fs\" -DPACKAGE_VERSION=\"1.77\" -DPACKAGE_STRING=\"s3fs\ 1.77\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"s3fs\" -DVERSION=\"1.77\" -DHAVE_MALLOC_TRIM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp fdcache.cpp: In member function ‘int FdEntity::Load(off_t, off_t)’: fdcache.cpp:800:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if((*iter)->bytes >= (2 \* S3fsCurl::GetMultipartSize()) && !nomultipart){ // default 20MB
kerem closed this issue 2026-03-04 01:41:20 +03:00
Author
Owner

@ggtakec commented on GitHub (Aug 14, 2014):

Hi,

Now, the line about problem is following in master branch:
if((*iter)->bytes >= static_cast<size_t>(2 * S3fsCurl::GetMultipartSize()) && !nomultipart){

I don't know why the error message is put without "static_cast<size_t>".
If you can, please check your source codes and master branch.
I need to know the reason about it.

Thanks in advance for your help.

<!-- gh-comment-id:52205047 --> @ggtakec commented on GitHub (Aug 14, 2014): Hi, Now, the line about problem is following in master branch: if((*iter)->bytes >= static_cast<size_t>(2 \* S3fsCurl::GetMultipartSize()) && !nomultipart){ I don't know why the error message is put without "static_cast<size_t>". If you can, please check your source codes and master branch. I need to know the reason about it. Thanks in advance for your help.
Author
Owner

@pajarom commented on GitHub (Aug 29, 2014):

Sorry for the delay responding. I have tested your change and it works
for me:

ITT-EUW-FE-004-C3XL-001 # make
g++ -DPACKAGE_NAME=\"s3fs\" -DPACKAGE_TARNAME=\"s3fs\"
-DPACKAGE_VERSION=\"1.77\" -DPACKAGE_STRING=\"s3fs\ 1.77\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"s3fs\"
-DVERSION=\"1.77\" -DHAVE_MALLOC_TRIM=1 -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I.
-D_FILE_OFFSET_BITS=64 -I/usr/include/fuse
-I/usr/include/libxml2     -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -MT
fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp
mv -f .deps/fdcache.Tpo .deps/fdcache.Po
g++  -g -O2 -Wall -D_FILE_OFFSET_BITS=64   -o s3fs s3fs.o curl.o
cache.o string_util.o s3fs_util.o fdcache.o -pthread -L/lib64 -lfuse
-lcurl -lxml2 -lcrypto
ITT-EUW-FE-004-C3XL-001 # git diff
diff --git a/src/fdcache.cpp b/src/fdcache.cpp
index f290931..aef75a5 100644
--- a/src/fdcache.cpp
+++ b/src/fdcache.cpp
@@ -797,7 +797,7 @@ int FdEntity::Load(off_t start, off_t size)
          break;
        }
        // download
-      if((*iter)->bytes >= (2 * S3fsCurl::GetMultipartSize()) &&
!nomultipart){ // default 20MB
+      if((*iter)->bytes >= static_cast<size_t>(2 *
S3fsCurl::GetMultipartSize()) && !nomultipart){ // default 20MB
          // parallel request
          // Additional time is needed for large files
          time_t backup = 0;
ITT-EUW-FE-004-C3XL-001 # git log
commit c7665f80ab58eccb3378521787515737929f365e
Merge: a446510 1a4065b
Author: Takeshi Nakatani <ggtakec@gmail.com>
Date:   Sun Apr 20 01:10:21 2014 +0900

     Merge pull request #33 from s3fs-fuse/for_v1.77

     changed for version v1.77 and fixed man page

Let me know if you need me to test anything else.
Regards,
Pablo

On 08/14/2014 06:14 PM, Takeshi Nakatani wrote:

Hi,

Now, the line about problem is following in master branch:
if((*iter)->bytes >= static_cast(2 * S3fsCurl::GetMultipartSize()) &&
!nomultipart){

I don't know why the error message is put without "static_cast".
If you can, please check your source codes and master branch.
I need to know the reason about it.

Thanks in advance for your help.


Reply to this email directly or view it on GitHub
https://github.com/s3fs-fuse/s3fs-fuse/issues/47#issuecomment-52205047.

<!-- gh-comment-id:53842764 --> @pajarom commented on GitHub (Aug 29, 2014): Sorry for the delay responding. I have tested your change and it works for me: ``` ITT-EUW-FE-004-C3XL-001 # make g++ -DPACKAGE_NAME=\"s3fs\" -DPACKAGE_TARNAME=\"s3fs\" -DPACKAGE_VERSION=\"1.77\" -DPACKAGE_STRING=\"s3fs\ 1.77\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"s3fs\" -DVERSION=\"1.77\" -DHAVE_MALLOC_TRIM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp mv -f .deps/fdcache.Tpo .deps/fdcache.Po g++ -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -o s3fs s3fs.o curl.o cache.o string_util.o s3fs_util.o fdcache.o -pthread -L/lib64 -lfuse -lcurl -lxml2 -lcrypto ITT-EUW-FE-004-C3XL-001 # git diff diff --git a/src/fdcache.cpp b/src/fdcache.cpp index f290931..aef75a5 100644 --- a/src/fdcache.cpp +++ b/src/fdcache.cpp @@ -797,7 +797,7 @@ int FdEntity::Load(off_t start, off_t size) break; } // download - if((*iter)->bytes >= (2 * S3fsCurl::GetMultipartSize()) && !nomultipart){ // default 20MB + if((*iter)->bytes >= static_cast<size_t>(2 * S3fsCurl::GetMultipartSize()) && !nomultipart){ // default 20MB // parallel request // Additional time is needed for large files time_t backup = 0; ITT-EUW-FE-004-C3XL-001 # git log commit c7665f80ab58eccb3378521787515737929f365e Merge: a446510 1a4065b Author: Takeshi Nakatani <ggtakec@gmail.com> Date: Sun Apr 20 01:10:21 2014 +0900 Merge pull request #33 from s3fs-fuse/for_v1.77 changed for version v1.77 and fixed man page ``` Let me know if you need me to test anything else. Regards, Pablo On 08/14/2014 06:14 PM, Takeshi Nakatani wrote: > Hi, > > Now, the line about problem is following in master branch: > if((*iter)->bytes >= static_cast(2 \* S3fsCurl::GetMultipartSize()) && > !nomultipart){ > > I don't know why the error message is put without "static_cast". > If you can, please check your source codes and master branch. > I need to know the reason about it. > > Thanks in advance for your help. > > — > Reply to this email directly or view it on GitHub > https://github.com/s3fs-fuse/s3fs-fuse/issues/47#issuecomment-52205047.
Author
Owner

@ggtakec commented on GitHub (Aug 30, 2014):

That it works just fine, it was good.
I closed this issue.
Thanks.

<!-- gh-comment-id:53962729 --> @ggtakec commented on GitHub (Aug 30, 2014): That it works just fine, it was good. I closed this issue. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#30
No description provided.