Description
Hey,
I tried to install the gem on an Ubuntu server in order to run ethereum.rb.
But I got an error. This is the console report
sudo gem install digest-sha3
Building native extensions. This could take a while...
ERROR: Error installing digest-sha3:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/digest-sha3-1.1.0/ext/digest
/usr/bin/ruby2.3 -r ./siteconf20170620-36620-a9fw36.rb extconf.rb
checking for ruby/digest.h... yes
checking for rb_str_set_len()... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/digest-sha3-1.1.0/mkmf.log
current directory: /var/lib/gems/2.3.0/gems/digest-sha3-1.1.0/ext/digest
make "DESTDIR=" clean
current directory: /var/lib/gems/2.3.0/gems/digest-sha3-1.1.0/ext/digest
make "DESTDIR="
compiling KeccakF-1600-reference.c
compiling KeccakNISTInterface.c
compiling KeccakSponge.c
compiling displayIntermediateValues.c
displayIntermediateValues.c: In function ‘displayText’:
displayIntermediateValues.c:113:9: error: format not a string literal and no format arguments [-Werror=format-security]
fprintf(intermediateValueFile, text);
^
cc1: some warnings being treated as errors
Makefile:239: recipe for target 'displayIntermediateValues.o' failed
make: *** [displayIntermediateValues.o] Error 1
make failed, exit code 2
It seems the command fprintf(intermediateValueFile, text); in intermediateValues.c does not precise the type of text variable thus raises a warning and stops the compiler (Ubuntu has not been compiling with such warning since some recent update).
Would simply remplace fprintf(intermediateValueFile, "%s", text) fix the issue ?