0

Currently, in my macOS CI, I get the error of uint64 should be treated as unsigned long long

format specifies type 'unsigned long' but the argument has type 'uint64' (aka 'unsigned long long')

whereas in my Ubuntu 18.04 & 20.04 CI I get the error of uint64 should be treated as unsigned long

format specifies type 'unsigned long long' but the argument has type 'uint64' (aka 'unsigned long')

Switching between %lu and %llu in my print statement will fix it for one of them and breaks it for the other of course.

LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %lu",
                               e.action.setInstanceData64.field, targets->front()->GetGUID().GetRawValue());

How can this be and how could I solve this issue?

Kitzunu
  • 201
  • 2
  • 5
  • maybe you have some macro that redefines the type with something like `#declare`? – Alberto Sinigaglia Jun 21 '21 at 12:31
  • Always include relevant code in the question, not as links to outside web sites. External links may be used for supplemental information, but they change and vanish over time. All information necessary to understand a question should be in the question itself. – Eric Postpischil Jun 21 '21 at 12:33
  • Sorry if I closed the post as a duplicate a bit too hastily (thought it was C instead of C++, so I wielded my hammer accidentally) ... maybe your `LOG_DEBUG` doesn't support the `` format specifiers? Probably does, though, as they are usually expressed as macros that just substitute string literals. – Adrian Mole Jun 21 '21 at 12:33
  • @AdrianMole it is still not clear what the solution to this specific problem would be, I'd reopen this question to be honest – Francesco Borzi Jun 21 '21 at 12:53
  • 3
    @FrancescoBorzi My 'suggestion' was to use the `PRu64` format specifier, as given in the top/accepted answer. But is that valid C++ (it's *formally* in the C99 Standard). That's *precisely* what those `PRxxx` format stuffs were designed for. – Adrian Mole Jun 21 '21 at 12:57
  • 1
    Note that it's not the OS that determines this, but the compiler. When you change to a different OS you also change to a different compiler. Often compilers for the same OS will apply the same conventions, but, still, it's the compiler that decides. – Pete Becker Jun 21 '21 at 13:18
  • @AdrianMole got it, thanks. Fix here: https://github.com/azerothcore/azerothcore-wotlk/pull/6479 – Francesco Borzi Jun 21 '21 at 13:38

0 Answers0