heasm66 / mdlzork

Different versions of original mainframe Zork reconstructed and patched to run under Confusion.
15 stars 6 forks source link

One more Confusion compiler warning #47

Closed heasm66 closed 1 year ago

heasm66 commented 1 year ago
mdl_output.cpp: In function ‘void mdl_print_nonstructured_to_chan(mdl_value_t*, const mdl_value_t*, int, bool, bool, mdl_value_t*)’:
mdl_output.cpp:698:38: warning: format ‘%llo’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘long int’ [-Wformat=]
  698 |                 sprintf(buf, "*%022llo*", a->v.w);
      |                                ~~~~~~^    ~~~~~~
      |                                      |         |
      |                                      |         long int
      |                                      long long unsigned int
      |                                %022lo

Should be safe to do an explicit conversion:

                sprintf(buf, "*%022llo*", (long long unsigned) a->v.w);