FreeBSD stdarg support
FreeBSD gives out this rather excluding message when including stdio.h:
/usr/include/sys/_types.h:135: #error "No support for your compiler for stdargs"
It is triggered by is this condition in cdefs.h not being met (and the guarded macros not getting set):
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3)
#define __GNUCLIKE_BUILTIN_VARARGS 1
#define __GNUCLIKE_BUILTIN_STDARG 1
#define __GNUCLIKE_BUILTIN_VAALIST 1
#endif
I'll eventually define __GNUC__ macro, and I think that should fix this problem. I'm not doing it right now because it opens a can of warms. If you define __GNUC__, the stdlib headers expect that your compiler supports all GCC extensions, such as various kinds of __attribute__. So, I'll do that after the extensions are implemented.
Right, setting __GNUC __ yields this:
/usr/include/sys/cdefs.h:228: #define __aligned(x) __attribute__((__aligned__(x)))
^ expected ','
Edit: I've tried setting a breakpoint at the point where that error should be produced, but did not realize chibicc relaunches itself at first.
What do you use to write code? Is it a diary?