Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD stdarg support #21

Open
ppenzin opened this issue Oct 27, 2020 · 3 comments
Open

FreeBSD stdarg support #21

ppenzin opened this issue Oct 27, 2020 · 3 comments
Labels
portability Portability issues which will be fixed later

Comments

@ppenzin
Copy link

ppenzin commented Oct 27, 2020

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
@rui314
Copy link
Owner

rui314 commented Oct 29, 2020

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.

@rui314 rui314 added the portability Portability issues which will be fixed later label Oct 29, 2020
@ppenzin
Copy link
Author

ppenzin commented Oct 30, 2020

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.

@qq528134537
Copy link

What do you use to write code? Is it a diary?

This was referenced Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
portability Portability issues which will be fixed later
Projects
None yet
Development

No branches or pull requests

3 participants