# Bro internal integers types. Use stdint.h

**URL:** https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696
**Category:** Development
**Tags:** development
**Created:** [November 6, 2010, 1:26am UTC](https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696 "2010-11-06T01:26:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gregor\_Maier](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@Gregor\_Maier](https://community.zeek.org/u/Gregor_Maier)
#### Post date: [November 6, 2010, 1:26am UTC](https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696/1 "2010-11-06T01:26:50Z")

</div>

Hi,

Currently Bro defines it's own integer types (uint32, uint64,  
bro\_int\_t, etc.) with the help of ifdefs and autoconf. Furthermore, Bro  
uses ifdef to decide which printf format to use for formatting 32 and 64  
bit integers.

As part of the planned event engine cleanup, I suggest that we  
&nbsp;&nbsp;a) make sure that everything that can potentially overflow (counters)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are 64 bit wide (in addition to enabling --enable-int64)  
&nbsp;&nbsp;b) use the standard type uint64\_t, int32\_t, etc. from inttypes.h (\*)  
&nbsp;&nbsp;c) use the PRI\* macros for \*printf formatting (also from inttypes.h)

(\*) inttypes.h is part of both, C99 and POSIX. See  
[http://www.opengroup.org/onlinepubs/000095399/basedefs/inttypes.h.html](http://www.opengroup.org/onlinepubs/000095399/basedefs/inttypes.h.html)

Comments?

cu  
Gregor

---

<div class="post-metadata">

### Author: ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)
#### Post date: [November 6, 2010, 2:05am UTC](https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696/2 "2010-11-06T02:05:32Z")

</div>

Ack.

My only concern is that I think Vern and I have discussed something  
along these lines in the past and there was some road-block. Vern,  
do you remember anything in that regard?

Robin

---

<div class="post-metadata">

### Author: ![Vern](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/vern/32/630_2.png) [@Vern](https://community.zeek.org/u/Vern)
#### Post date: [November 6, 2010, 8:21pm UTC](https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696/3 "2010-11-06T20:21:42Z")

</div>

> My only concern is that I think Vern and I have discussed something  
> along these lines in the past and there was some road-block. Vern,  
> do you remember anything in that regard?

It's not coming to mind ...

&nbsp;&nbsp;&nbsp;&nbsp;Vern

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)
#### Post date: [May 6, 2022, 3:39pm UTC](https://community.zeek.org/t/bro-internal-integers-types-use-stdint-h/1696/4 "2022-05-06T15:39:13Z")

</div>


