Brandon J. Van Every wrote:
chicken.h contains:

#ifdef C_DEFAULT_TARGET_STACK_SIZE
# define C_resize_stack(n) C_do_resize_stack(C_DEFAULT_TARGET_STACK_SIZE)
#else
# define C_resize_stack(n)           C_do_resize_stack(n)
#endif

The only consumer is c-backend.scm:

       (when target-stack-size
           (gen #t "C_resize_stack(" target-stack-size ");") ) )

Can C_resize_stack be moved out of chicken.h and into c-backend.scm? Currently, in terms of the build, C_DEFAULT_TARGET_STACK_SIZE is circular. To determine it with nsample, we need to build libchicken, but libchicken includes chicken.h. My agenda is I'm trying to get all these various command line -D flags into .h files where they're easier to read and manage in the build. So I can't do #include "stack-size.h" in chicken.h because it would be circular and has to be determined later.

Hrm, it appears the code doesn't work as I first thought. There is no C section in c-backend.scm, so I suppose that means everyone uses C_resize_stack(n) in generated code all over the place. This also means there's no well-defined point of control for whether C_DEFAULT_TARGET_STACK_SIZE is used. If a compilation is passed a -D flag, it happens; if not, it doesn't. That makes me nervous. I'd rather see this #defined in a .h file somewhere. Somewhere other than chicken.h to avoid circularity.


Cheers,
Brandon Van Every



_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to