Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-09 Thread Gabriel Dos Reis
On Thu, Feb 9, 2012 at 8:24 PM, Daniel Herring wrote: > On Fri, 3 Feb 2012, Juan Jose Garcia-Ripoll wrote: > >> I just noticed that some cleverly optimizing compilers broke the code I used >> to detect whether the stack grows upwards or downwards. I will upload a >> patch tonight. > > Wouldn't t

Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-09 Thread Daniel Herring
On Fri, 3 Feb 2012, Juan Jose Garcia-Ripoll wrote: > I just noticed that some cleverly optimizing compilers broke the code I used > to detect whether the stack grows upwards or downwards. I will upload a patch > tonight. Wouldn't two calls to alloca() in a single function give a reliable answer

Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-03 Thread Juan Jose Garcia-Ripoll
On Fri, Feb 3, 2012 at 5:24 PM, Gabriel Dos Reis < g...@integrable-solutions.net> wrote: > > This confusese two things: (1) the existence of a stack; (2) the > direction of growth. > The test for (2) is invoking an undefined behaviour. Therefore, the > outcome of > that test does not say anything

Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-03 Thread Gabriel Dos Reis
On Fri, Feb 3, 2012 at 10:13 AM, Juan Jose Garcia-Ripoll wrote: > ECL is assuming that local variables are kept in the stack. Is this wrong? What is undefined behaviour isn't assuming the notion of "stack" -- which the C standard effectively does not know about. The crucial point is that it is

Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-03 Thread Juan Jose Garcia-Ripoll
On Fri, Feb 3, 2012 at 4:45 PM, Gabriel Dos Reis < g...@integrable-solutions.net> wrote: > On Fri, Feb 3, 2012 at 8:23 AM, Juan Jose Garcia-Ripoll > wrote: > > I just noticed that some cleverly optimizing compilers broke the code I > used > > to detect whether the stack grows upwards or downwards

Re: [Ecls-list] Bug in code detecting stack growth direction

2012-02-03 Thread Gabriel Dos Reis
On Fri, Feb 3, 2012 at 8:23 AM, Juan Jose Garcia-Ripoll wrote: > I just noticed that some cleverly optimizing compilers broke the code I used > to detect whether the stack grows upwards or downwards. I will upload a > patch tonight. Hmm. The code in question invoked an undefined behaviour. So,