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

Bunch of compiler warnings during compilation of current master current master #407

Closed
pbiering opened this issue Oct 3, 2017 · 7 comments

Comments

@pbiering
Copy link

pbiering commented Oct 3, 2017

encfs-master/vendor/github.com/muflihun/easyloggingpp/src/easylogging++.h:
1421x defined but not used [-Wunused-variable]

others have marginal amount:

encfs-master/encfs/BlockFileIO.cpp:62:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:92:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:129:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:168:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:229:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:231:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/BlockFileIO.cpp:286:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/CipherFileIO.cpp:391:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/CipherFileIO.cpp:538:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
encfs-master/encfs/CipherFileIO.cpp:549:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

// solved (Ben) :
encfs-master/encfs/readpassphrase.cpp:128:46: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/readpassphrase.cpp:149:33: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/DirNode.cpp:524:21: warning: ignoring return value of 'int setfsuid(__uid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/DirNode.cpp:527:21: warning: ignoring return value of 'int setfsgid(__gid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/encfs.cpp:464:23: warning: ignoring return value of 'int setfsuid(__uid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/encfs.cpp:467:23: warning: ignoring return value of 'int setfsgid(__gid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/FileNode.cpp:197:21: warning: ignoring return value of 'int setfsuid(__uid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/FileNode.cpp:200:21: warning: ignoring return value of 'int setfsgid(__gid_t)', declared with attribute warn_unused_result [-Wunused-result]
encfs-master/encfs/RawFileIO.cpp:155:13: warning: 'eno' may be used uninitialized in this function [-Wmaybe-uninitialized]

// solved (Ben) :
encfs-master/encfs/DirNode.cpp:78:2: warning: #warning "struct dirent.d_type not supported" [-Wcpp]
 #warning "struct dirent.d_type not supported"

attached the whole build log (compressed):
rpmbuild-fuse-encfs.log.gz

@benrubson
Copy link
Contributor

benrubson commented Oct 3, 2017

And you also needed to add -fPIC due to the following :

/usr/bin/ld: vendor/github.com/muflihun/easyloggingpp/libeasyloggingpp.a(easylogging++.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
vendor/github.com/muflihun/easyloggingpp/libeasyloggingpp.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Is it due to -std=gnu++11 which is added by your compilation spec file ?

@benrubson
Copy link
Contributor

benrubson commented Oct 3, 2017

Finally, you also said that because of the by default (?) now installed benchmark headers and libraries, a bunch of files must be "removed" before packaging is successful.
Do they make the build fail ?

@pbiering
Copy link
Author

pbiering commented Oct 3, 2017

-std=gnu+11 was default also for 1.9.2, -fPIC is now required for "master", probably because of the included performance code (which is imho not needed to be built for RPM at all, some kind of build/configure option should be implemented to deselect this).

Libraries are removed because they were not occuring in 1.9.2-3, looks like "make install" of "master" installs much files than 1.9.2-3:

%install
%make_install -C %{_target_platform}
rm -f %{buildroot}/%{_libdir}/*.la
rm -f %{buildroot}/%{_libdir}/*.so

# remove all include files
rm -fr %{buildroot}/usr/include/*

# remove all i386 benchmark/mock related libraries
rm -f %{buildroot}/%{_libdir}/libbenchmark*
rm -f %{buildroot}/%{_libdir}/libeasyloggingpp*
rm -f %{buildroot}/%{_libdir}/libgmock*
rm -f %{buildroot}/%{_libdir}/libgtest*
rm -fr %{buildroot}/%{_libdir}/cmake/*

rm -f %{buildroot}/usr/lib/libbenchmark*
rm -f %{buildroot}/usr/lib/libeasyloggingpp*
rm -f %{buildroot}/usr/lib/libgtest*
rm -f %{buildroot}/usr/lib/libgmock*
rm -fr %{buildroot}/usr/lib/cmake/*

If I do not remove them after "make install", RPM build process claims about a lot of files not included but existing -> either subpackages "-devel" and "perftest" will be added or "make install" learn not to include "devel" and "perftest" files by default...

@benrubson
Copy link
Contributor

benrubson commented Oct 3, 2017

I just corrected 9 of the above compilation warnings (I gently edited your first post to keep track of modifications).

@pbiering
Copy link
Author

pbiering commented Oct 4, 2017

Test system:

# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
# rpm -qf $(which cmake)
cmake-2.8.12.2-2.el7.x86_64

-> if you want that encfs can be builded proper on latest Enterprise Linux, it should be "somehow" backwards compatible and detect cmake versions < 3.

@benrubson
Copy link
Contributor

For this one :

encfs-master/encfs/DirNode.cpp:78:2: warning: #warning "struct dirent.d_type not supported" [-Wcpp]
 #warning "struct dirent.d_type not supported"

I finally just committed a fix which should help correctly detecting dirent.d_type.

@benrubson
Copy link
Contributor

benrubson commented Oct 11, 2017

@pbieringy you should still see some -Wsign-compare warnings (which will be solved), but you should be able to compile / package much more easily.
Thx 👍

@benrubson benrubson removed this from the 1.9.3 milestone Oct 14, 2017
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