From 341c0b1988542f88f6c506145fda2ebd694f3331 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 23 Nov 2013 20:24:49 -0500 Subject: [PATCH] Improve stack direction detection When the function in the test program is inlined, all bets are off whether the detection will work correctly or not. Make it harder for the compiler to play games on us by making the function recursive. https://bugzilla.gnome.org/show_bug.cgi?id=307947 --- configure.ac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 7d268dbcc..3811a2695 100644 --- a/configure.ac +++ b/configure.ac @@ -596,9 +596,8 @@ dnl AC_CACHE_CHECK([for growing stack pointer],glib_cv_stack_grows,[ AC_TRY_RUN([ volatile int *a = 0, *b = 0; - void foo (void); - int main () { volatile int y = 7; a = &y; foo (); return b > a; } - void foo (void) { volatile int x = 5; b = &x; } + void f (int i) { volatile int x = 5; if (i == 0) b = &x; else f (i - 1); } + int main () { volatile int y = 7; a = &y; f (100); return b > a; } ], glib_cv_stack_grows=yes ,