[Ecls-list] Stack direction and gcc 5.0

Evrim Ulu evrimulu at gmail.com
Mon Feb 23 05:43:30 UTC 2015


Hello Jerry,

I've looked to stddef.h and it seems its in the standard, so i expect
every system has this header and type definition ptrdiff_t.
Please object to this, I'm really annoyed that autoconf doesn't have a
m4 macro to decide stack direction.
I really don't get why we are still trying to do it project by project.

Anyway, here is the patch:
https://github.com/evrim/ecl-mobile/commit/dd1f4a56849811199f1c0e048edc2474a0ec0f8f

I'll push it when I get commit access.

Enjoy,
evrim.

On Sat, Feb 21, 2015 at 2:33 AM, Jerry James <loganjerry at gmail.com> wrote:
> 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;
>   else
>     return 0;
> }
>
> Regards,
> --
> Jerry James
> http://www.jamezone.org/
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list




More information about the ecl-devel mailing list