depqbf icon indicating copy to clipboard operation
depqbf copied to clipboard

fix warnings with wrong formats in fprintf

Open fsasm opened this issue 2 years ago • 0 comments

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

fsasm avatar Apr 11 '23 14:04 fsasm