[Ecls-list] Stack direction and gcc 5.0

Jerry James loganjerry at gmail.com
Fri Feb 20 17:33:52 UTC 2015

GCC 5.0 is near release, and Fedora has started building packages with
it.  The ECL build is failing because the stack direction code in
src/aclocal.m4 has started returning wrong values.  I don't know why.
But I do know that replacing the test code with this returns the
correct answer:

#include <stddef.h>
#include <stdlib.h>

ptrdiff_t f2(const char *d) {
  char c[2];
  return c-d;

ptrdiff_t f1(const char *d) {
  char c[2];
  return c+1-d;

typedef ptrdiff_t (*f_ptr)(const char *);
f_ptr f[2] = { f1, f2 };

ptrdiff_t signo() {
  char d[1];
  return f[rand() & 1](d);

int main() {
  if (signo() > 0)
    return 1;
    return 0;

Jerry James

More information about the ecl-devel mailing list