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

Compilation warnings #57

Open
jospezial opened this issue Jan 8, 2022 · 0 comments
Open

Compilation warnings #57

jospezial opened this issue Jan 8, 2022 · 0 comments

Comments

@jospezial
Copy link

With 1.5 and current master I see in Gentoo:

In file included from display.c:17:
display.c: In function ‘display’:
display.c:179:13: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
  179 |     PRINTW(("%08lX", (int) (base + i)));
      |             ^~~~~~~  ~~~~~~~~~~~~~~~~
      |                      |
      |                      int
hexedit.h:54:97: note: in definition of macro ‘ATTRPRINTW’
   54 | #define ATTRPRINTW(attr, a) do { if (oldattr != (attr)) attrset(attr), oldattr = (attr); printw a; } while (0)
      |                                                                                                 ^
display.c:179:5: note: in expansion of macro ‘PRINTW’
  179 |     PRINTW(("%08lX", (int) (base + i)));
      |     ^~~~~~
display.c:179:18: note: format string is defined here
  179 |     PRINTW(("%08lX", (int) (base + i)));
      |              ~~~~^
      |                  |
      |                  long unsigned int
      |              %08X
display.c:192:14: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
  192 |   printw("--%i%%", fsize == 0 ? 0 : 100 * (base + cursor + fsize/200) / fsize );
      |             ~^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              |                    |
      |              int                  long long int
      |             %lli
In file included from display.c:17:
display.c: In function ‘displayLine’:
display.c:204:11: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
  204 |   PRINTW(("%08lX   ", (int) (base + offset)));
      |           ^~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~
      |                       |
      |                       int
hexedit.h:54:97: note: in definition of macro ‘ATTRPRINTW’
   54 | #define ATTRPRINTW(attr, a) do { if (oldattr != (attr)) attrset(attr), oldattr = (attr); printw a; } while (0)
      |                                                                                                 ^
display.c:204:3: note: in expansion of macro ‘PRINTW’
  204 |   PRINTW(("%08lX   ", (int) (base + offset)));
      |   ^~~~~~
display.c:204:16: note: format string is defined here
  204 |   PRINTW(("%08lX   ", (int) (base + offset)));
      |            ~~~~^
      |                |
      |                long unsigned int
      |            %08X

I wanted to try if #38 fixes these but that PR has to be rebased to be merged into master.

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

1 participant