Wireshark-dev: Re: [Wireshark-dev] What's wrong with %ll ?
From: Antoine d'Otreppe <a.dotreppe@xxxxxxxxxx>
Date: Thu, 15 Nov 2018 21:17:21 +0000
Spot on! Thanks Pascal!



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, November 15, 2018 10:14 PM, Pascal Quantin <pascal.quantin@xxxxxxxxx> wrote:

Hi Antoine,

Le jeu. 15 nov. 2018 à 22:09, Antoine d'Otreppe <a.dotreppe@xxxxxxxxxx> a écrit :
Hi devs :)

Small pickle here. Can you enlighten me? Travis clang builds complain about my format strings not using the right placeholders:

```
../epan/dissectors/packet-syncthing.c:156:57: error: format specifies type 'long' but the argument has type 'gint64' (aka 'long long') [-Werror,-Wformat]
        proto_item_set_text(header, "Instance ID: %li", instance_id);
                                                  ~~~   ^~~~~~~~~~~
                                                  %lli
```

"Well that's all fine, I can fix it", says I.
But wait, now that I put %lli, I can't commit anymore because the pre-commit hook is not happy:


```
$ git commit -m "Fixed more int errors"
Error: Found %ll in epan/dissectors/packet-syncthing.c
```

What should I do here?

While on that topic, I also need to format a guint64. What should I use for that?

Use G_GINT64_MODIFIER. See doc/README.developer for details.

Best regards,
Pascal.