Small-C icon indicating copy to clipboard operation
Small-C copied to clipboard

Small-C: Support local variable initialization

Open ZaneDubya opened this issue 6 years ago • 0 comments

“Instead of always waiting for the first executable instruction in a block before allocating space for locals, when an initializer is found, allocate pending locals, then evaluate the initializing expression and push the result onto the stack as the current object. Whereas global initializers must be constant expressions, local initializers are not so restricted. Originally, C did not support initializing local arrays, current compilers tend to allow it, however. Is this something you want to support? Don't forget that the element values must be pushed from right to left so the first element will have the lowest address. Also, uninitialized elements should be set to zero. ” -Excerpt From: James E. Hendrix. “A Small C Compiler.”

ZaneDubya avatar Dec 23 '17 17:12 ZaneDubya