1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00
cc65/test/ref/inline-error.c
acqn ba75a2ac26 Added missing checks for forward declarations of the main() function.
More accurate diagnosis on implicit 'int' type specifiers.
2024-01-23 14:33:05 +08:00

39 lines
1.6 KiB
C

/* C99 inline in declarations */
inline typedef int; /* Error */
static inline int; /* Error */
inline static int a1; /* Error */
int inline (*fp1)(void); /* Error */
typedef inline int f1_t(void); /* Error */
inline int f1a(void); /* OK here warning later */
inline extern int f1b(void); /* OK here warning later */
extern inline int f1b(void); /* Same as above */
inline static int f1c(void); /* OK here warning later */
static inline int f1c(void); /* Same as above */
void foo(inline int x); /* Error */
int a = sizeof (inline int); /* TODO: better error message */
int b = sizeof (inline int (int)); /* TODO: better error message */
inline int main(void) /* Error */
{
inline typedef int; /* Error */
static inline int; /* Error */
extern inline int a2; /* Error */
int inline (*fp2)(void); /* Error */
typedef inline int f2_t(void); /* Error */
inline int f2a(void); /* OK here warning later */
inline extern int f2b(void); /* OK here warning later */
extern inline int f2b(void); /* Same as above */
f1a(); /* Still imported */
f1b(); /* Still imported */
f1c(); /* Not imported */
f2a(); /* Still imported */
f2b(); /* Still imported */
}
inline int main(void); /* Error */
/* Warning: non-external inline functions declared but undefined in TU */