Skip to content

fix warnings with wrong formats in fprintf#20

Open
fsasm wants to merge 1 commit intolonsing:masterfrom
fsasm:master
Open

fix warnings with wrong formats in fprintf#20
fsasm wants to merge 1 commit intolonsing:masterfrom
fsasm:master

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