large stack variables in shttpd

Aaron J. Grier aaron at frye.com
Tue Jul 31 17:32:20 UTC 2007


On Tue, Jul 31, 2007 at 10:19:14AM -0500, Joel Sherrill wrote:
> In building for the avr and h8300, there were errors building.  When I
> investigated, I came across this in shttpd:
> 
> defs.h:#define  URI_MAX         32768           /* Maximum URI size */
> log.c:  char    date[64], buf[URI_MAX];
> log.c:  char                    date[64], buf[URI_MAX], *q1 = "\"", *q2 = "\"";
> shttpd.c:       char            path[URI_MAX], buf[1024];
> 
> So there are 3 places where shttpd puts 32K on the
> stack.  Two are for logging.
>
> Any thoughts on what to do?

move them out of the function and declare them static; that should at
least put them in .bss.  or cut down URI_MAX to something more
reasonable.

AVR == AVR32, I assume?  or is RTEMS running on 8bit AVR now?

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron at frye.com



More information about the users mailing list