mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-15 05:46:15 +01:00
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
This commit is contained in:
parent
df71ecfc2d
commit
341c0b1988
@ -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
|
||||
,
|
||||
|
Loading…
Reference in New Issue
Block a user