> | this overflow of stack in assembly: > | > | read_infos: > | .LLFB46: > | .loc 1 197 0 > | !#PROLOGUE# 0 > | save %sp, --2147483544, %sp > | > | Notice the double negative, produces by overflowing the stack pointer, > > I'm not very familiar with compilers internals but (I once made > a code-generator, that's all) but how can a double negative can > happen ?
It is basically this: fprintf(asm_file, "\tsave\t%sp, -%d, %sp\n", size_of_stack); So the first negative is hardcoded (because the stack decreases down always) and the second one is just the result of SSIZE_MAX plus some (registering saving, etc), which overflows to a negative value. > > | which only uses, internally, a signed int. That is plenty enough to hold > | a normal, legal stack, but not really enough for your needs. > > Ok. So wouldn't it be more usefull to get a compiler message that > is more explicit ? I agree. I think the compiler should produce an error instead of the --. That's probably something that each arch should handle though. > | If you need that much (I can't see that you would), then malloc it. > > I don't need that much, in fact. I just need to ensure that what > is send from one side of a client/server connection is fully > received at the other side... Then probably a 1024 byte buffer, and a loop to read/process it until it's all read. You'd have to make sure the connection was non-blocking though. -- Debian - http://www.debian.org/ Linux 1394 - http://www.linux1394.org/ Subversion - http://subversion.tigris.org/ WatchGuard - http://www.watchguard.com/