Wireshark mailing list archives

Re: What's wrong with %ll ?


From: Pascal Quantin <pascal.quantin () gmail com>
Date: Thu, 15 Nov 2018 22:14:55 +0100

Hi Antoine,

Le jeu. 15 nov. 2018 à 22:09, Antoine d'Otreppe <a.dotreppe () aspyct org> 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.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: