Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Remove uint64_t format specifier warnings #216

Merged
merged 1 commit into from Mar 1, 2014

Conversation

Projects
None yet
2 participants
Contributor

blutack commented Feb 13, 2014

There are format build warnings present with GCC 4.8.1 on Linux.

src/core/global.c: In function ‘nn_global_submit_counter’:
src/core/global.c:904:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=]
             s->socket_name, name, value);
             ^
src/core/global.c:919:17: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ [-Wformat=]
                 timebuf, value);
                 ^
src/core/global.c:923:17: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ [-Wformat=]
                 timebuf, value);
                 ^

This patch explicitly casts 'value' to match the format specifier, and results in a clean build.

Remove unit64_t format specifier warnings
Explicitly cast to long long unsigned int to remove build warnings.
Owner

tailhook commented Mar 1, 2014

Patch seems ok. Can you state that the patch is submitted under MIT license?

Owner

tailhook commented Mar 1, 2014

Also what name should I add to the AUTHORS file?

Contributor

blutack commented Mar 1, 2014

I hereby state that this patch is submitted under the MIT license.
If it's worth adding to AUTHORS for such a trivial fix, could you pop it under Gareth Roberts, blutack at gmail please?

tailhook added a commit that referenced this pull request Mar 1, 2014

Merge pull request #216 from blutack/master
Remove uint64_t format specifier warnings

@tailhook tailhook merged commit a3eecd8 into nanomsg:master Mar 1, 2014

Owner

tailhook commented Mar 1, 2014

Applied. Thanks!

Contributor

blutack commented Mar 1, 2014

You're welcome. Nanomsg is fantastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment