I'd like to be able to use GCC's `__builtin_alloca` without the C standard library.

This seems to work:

--- core/stdc/stdlib.d
module core.stdc.stdlib;
extern(C) void* alloca(size_t n) pure;
---

...but, since I'm not actually using the C standard library, I'd prefer to avoid creating that module hierarchy.


I tried simply adding...

--- {anyfile}.d
extern extern(C) void* __builtin_alloca(size_t size) pure;
---

... to my existing files, but I get an undefined reference for `__bulitin_alloca`.


LDC was pretty straightforward with:
--- {anyfile}.d
pragma(LDC_alloca)
void* alloca(size_t size) pure;
---

Is there a way to do something like that in GDC. I don't care if I have to use `__builtin_alloca` or some other identifier, I just don't want to create the C standard library module hierarchy.

Thanks,
Mike

Reply via email to