[FFmpeg-devel] [PATCH] don't include intypes.h directly

Måns Rullgård mans
Sat Nov 10 13:07:45 CET 2007

Aurelien Jacobs <aurel at gnuage.org> writes:

> Hi,
> I seem to recall that we had a "policy" of never including inttypes.h
> (or stdint.h) directly, but I'm not sure anymore.
> If I'm right, then I should apply the attached patch. OK ?
> Aurel
> Index: libavcodec/intrax8huf.h
> ===================================================================
> --- libavcodec/intrax8huf.h	(revision 10987)
> +++ libavcodec/intrax8huf.h	(working copy)
> @@ -19,7 +19,7 @@
> -#include <inttypes.h>
> +#include "common.h"

It looks like all this file needs is stdint.h, in which case that is
what it should be #including.  Needlessly including common.h will only
add false dependencies and increase compilation time (not by much, but

My personal policy is to explicitly include all headers from which
features are used, even if some of them might be indirectly included,
unless this indirect inclusion is documented (e.g. inttypes.h must
include stdint.h).

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list