8000 fix warnings with wrong formats in fprintf by fsasm · Pull Request #20 · lonsing/depqbf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix warnings with wrong formats in fprintf #20

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fsasm
Copy link
@fsasm fsasm commented Apr 11, 2023

On my system (Ubuntu 22.04, gcc 11.3.0, amd64) it generates the warnings below when compiling. This commit fixes the warnings by applying the changes suggested by the compiler.

cc -Wextra -Wall -Wno-unused-parameter -Wno-unused -pedantic -std=c99 -DNDEBUG -O3  -fPIC -c qdpll.c -o qdpll.fpico
qdpll.c: In function ‘cover_by_assignment_collect_univ_vars’:
qdpll.c:6808:63: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=]
 6808 |               fprintf (stderr, "seen blocked clause at level %d:\n",
      |                                                              ~^
      |                                                               |
      |                                                               int
      |                                                              %ld
 6809 |                        sp - qdpll->qbcp_qbce_blocked_clauses.start);
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                           |
      |                           long int
qdpll.c: In function ‘qbcp_qbce_delete_list_entry’:
qdpll.c:11414:71: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
11414 |       fprintf (stderr, "WATCHING: deleting list entry, new list size %u\n", QDPLL_COUNT_STACK (*list));
      |                                                                      ~^
      |                                                                       |
      |                                                                       unsigned int
      |                                                                      %lu
qdpll.c: In function ‘qbcp_qbce_find_blocked_clauses’:
qdpll.c:12607:107: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
12607 |                                 fprintf (stderr, "QBCE: skipping maybe blocking literal %d -- %soccs-cnt %u > limit %u\n",
      |                                                                                                          ~^
      |                                                                                                           |
      |                                                                                                           unsigned int
      |                                                                                                          %lu

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

Successfully merging this pull request may close these issues.

1 participant
0