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

sparsebundlefs fails to compile on linux #19

Closed
dClauzel opened this issue Sep 26, 2016 · 1 comment
Closed

sparsebundlefs fails to compile on linux #19

dClauzel opened this issue Sep 26, 2016 · 1 comment

Comments

@dClauzel
Copy link

I am trying to compile the current version, without success.

$ uname -a
Linux serveur 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux

$ make
g++ sparsebundlefs.cpp -o sparsebundlefs -Wall -O2 -g -march=native -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -lfuse -pthread -Wl,-rpath=/usr/lib/x86_64-linux-gnu -DFUSE_USE_VERSION=26
sparsebundlefs.cpp: In function ‘int sparsebundle_iterate_bands(const char*, size_t, off_t, sparsebundle_read_operations*)’:
sparsebundlefs.cpp:146:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (offset + length > sparsebundle->size)
         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
sparsebundlefs.cpp: In function ‘int sparsebundle_read_buf_process_band(const char*, size_t, off_t, void*)’:
sparsebundlefs.cpp:285:110: warning: narrowing conversion of ‘read’ from ‘ssize_t {aka long int}’ to ‘size_t {aka long unsigned int}’ inside { } [-Wnarrowing]
         fuse_buf buffer = { read, fuse_buf_flags(FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK), 0, band_file_fd, offset };
                                                                                                              ^
sparsebundlefs.cpp: In function ‘void sparsebundle_read_buf_close_files()’:
sparsebundlefs.cpp:308:92: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘std::map<std::__cxx11::basic_string<char>, int>::size_type {aka long unsigned int}’ [-Wformat=]
     syslog(LOG_DEBUG, "closing %u open file descriptor(s)", sparsebundle->open_files.size());
                                                                                            ^
sparsebundlefs.cpp: In function ‘int sparsebundle_read_buf(const char*, fuse_bufvec**, size_t, off_t, fuse_file_info*)’:
sparsebundlefs.cpp:335:46: error: narrowing conversion of ‘-1’ from ‘int’ to ‘rlim_t {aka long unsigned int}’ inside { } [-Wnarrowing]
     static struct rlimit fd_limit = { -1, -1 };
                                              ^
sparsebundlefs.cpp:335:46: error: narrowing conversion of ‘-1’ from ‘int’ to ‘rlim_t {aka long unsigned int}’ inside { } [-Wnarrowing]
sparsebundlefs.cpp:360:75: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
     syslog(LOG_DEBUG, "returning %d buffers to fuse", buffer_vector->count);
                                                                           ^
Makefile:23 : la recette pour la cible « sparsebundlefs » a échouée
make: *** [sparsebundlefs] Erreur 1
torarnv added a commit that referenced this issue Sep 27, 2016
We were using -1 as a sentinel to determine if we had computed the
file descriptor limit, but rlim_t is unsigned. Also, RLIM_INFINITY
is typically -1 as well, so the choice of -1 as a sentinel was
probably not a good idea anyways.

Closes issue #19.
@torarnv
Copy link
Owner

torarnv commented Sep 27, 2016

Fixed in f3ccd20

@torarnv torarnv closed this as completed Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants