What's the best way to ensure that stdint.h
is included for headers that use the types from that header?
The alternatives I can see are:
- including
stdint.h
in the header itself (dangerous, is it not?) - flagging something to the compiler if it's not included when parsing the header (something like
#ifndef _STDINT_H
with an accompanying#error "stdint.h not included"
- Educating the other developer in always including
stdint.h
before any of my headers that require it, either using comments, conversation, documentation or a mixture of all three (the last one being preferable).
If there are any other alternatives worth mentioning, feel free to do so - I'm just guessing at what I should do here.