In a header file I have the following code which gives me the error in the title, while trying to link.
#ifndef BOOLEAN_H
#define BOOLEAN_H
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE !FALSE
#endif
#endif
indicating the error occurs in the line of the last #endif
gcc
when compiled with -pedantic
reports a diagnostic when the translation unit is empty as it is requested by the C Standard. To make gcc
happy, you can add a dummy typedef
in the empty .c
file:
typedef int make_iso_compilers_happy;
or
extern int make_iso_compilers_happy;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With