ssdeep-project / ssdeep

Fuzzy hashing API and fuzzy hashing tool
https://ssdeep-project.github.io/ssdeep/index.html
GNU General Public License v2.0
671 stars 115 forks source link

Warnings when building in Debian (v2.14) #4

Open eribertomota opened 7 years ago

eribertomota commented 7 years ago

Hi,

When building ssdeep 2.14 in Debian, I can see the following messages:

main.cpp: In function ‘void generate_filename(state*, char*, char*, char*)’:
main.cpp:242:15: warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]
       realpath(input, fn);
       ~~~~~~~~^~~~~~~~~~~
engine.cpp: In function ‘int hash_file(state*, char*)’:
engine.cpp:58:5: warning: ‘%s’ directive output truncated writing 79 bytes into a region of size 68 [-Wformat-truncation=]
 int hash_file(state *s, TCHAR *fn) {
     ^~~~~~~~~
In file included from /usr/include/stdio.h:938:0,
                 from main.h:27,
                 from engine.cpp:3:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output 89 or more bytes into a destination of size 77
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
engine.cpp:58:5: warning: ‘%s’ directive output truncated writing 79 bytes into a region of size 68 [-Wformat-truncation=]
 int hash_file(state *s, TCHAR *fn) {
     ^~~~~~~~~
In file included from /usr/include/stdio.h:938:0,
                 from main.h:27,
                 from engine.cpp:3:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output 89 or more bytes into a destination of size 77
        __bos (__s), __fmt, __va_arg_pack ());

                                            ^
[...]

cycles.cpp: In function ‘int done_processing_dir(char*)’:
cycles.cpp:51:11: warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]
   realpath(fn,d_name);
   ~~~~~~~~^~~~~~~~~~~
cycles.cpp: In function ‘int processing_dir(char*)’:
cycles.cpp:107:11: warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]
   realpath(fn,d_name);
   ~~~~~~~~^~~~~~~~~~~
cycles.cpp: In function ‘int have_processed_dir(char*)’:
cycles.cpp:158:11: warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]
   realpath(fn,d_name);
   ~~~~~~~~^~~~~~~~~~~

[...]

ar: `u' modifier ignored since `D' is the default (see `U')**

Thanks!

Regards,

Eriberto

a4lg commented 7 years ago

It appears all problems existed before version 2.14 but I'm investigating...

warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]

This is indeed a problem when realpath fails. I consider this a low priority issue and will be fixed on the next version.

warning: ‘%s’ directive output truncated writing 79 bytes into a region of size 68 [-Wformat-truncation=]

This (itself) is not a problem. It's definitely a false-positive warning but this part of the code could be rewritten because it assumes fixed-width terminal.

ar: `u' modifier ignored since `D' is the default (see `U')**

No problem. It always happens because ar is updated.

a4lg commented 7 years ago

I'll leave this issue open until I commit realpath fix but I think nothing is blocking us from releasing Debian version of ssdeep 2.14. -- Oh, I forgot to refresh the page. Thanks for releasing it!

eribertomota commented 7 years ago

2017-09-18 19:38 GMT-03:00 Tsukasa #01 (a4lg) notifications@github.com:

I'll leave this issue open until I commit realpath fix but I think nothing is blocking us from releasing Debian version of ssdeep 2.14.

No, it was released yesterday.

Thanks!