If a project has a header that includes a second header and both of them include a common header, is it good practice to drop the inclusion of the common header from the first header and rely on the indirect inclusion via the second header?
e.g.:
I know the stdint.h
can be removed from temperature.h
, but should it be?
In temperature.h
:
#include <stdint.h> // *Should* this include be removed in this case.
#include "i2c.h"
extern uint16_t temperatureRead (i2cData_t x);
In i2c.h
:
#include <stdint.h>
typedef struct i2cData_t {
uint16_t exampleMember
} i2cData_t;