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

Compiling of sortindex.c gives warnings, doesn't seem to work #2

Open
vliegelientje opened this issue Oct 24, 2014 · 1 comment
Open

Comments

@vliegelientje
Copy link

When compiling sortidx.c some warnings are being displayed.
The executable hangs, no output is displayed...

$ make
gcc -O2 sortidx.c -o sortidx
sortidx.c: In function ‘main’:
sortidx.c:69:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int64_t’ [-Wformat=]
         printf("Invalid buffer size (%d).\n", bufsize);
         ^
sortidx.c:88:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int64_t’ [-Wformat=]
         printf("Cannot allocate buffer (%d bytes).\n", bufsize);
         ^
sortidx.c: In function ‘freadIndexEntryAt’:
sortidx.c:325:10: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
     fread(out->hash, sizeof(unsigned char), INDEX_HASH_WIDTH, file);
          ^
sortidx.c:326:10: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
     fread(out->position, sizeof(unsigned char), INDEX_POSITION_WIDTH, file);
@defuse
Copy link
Owner

defuse commented Oct 24, 2014

Sorry this is shitty code. 50b0eca fixes the format string issue.

If you're sorting a big index, it will appear to hang while it's sorting (possibly for days or weeks if it's REALLY big). Giving it more memory with -r helps bring more of the sort into RAM and speeds it up a lot. If it hangs on small files that's definitely a problem.

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