mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 11:17:37 +01:00
Fix the __progname check to avoid the optimizer discarding the symbol
Because we were assigning to another unused variable, when building the check with optimizations enabled, which is the default when using gcc as the compiler, the variable was being discarded. Instead pass it to printf() so that it cannot do so.
This commit is contained in:
parent
337e620275
commit
368af99f55
@ -131,9 +131,8 @@ AC_LINK_IFELSE(
|
|||||||
|
|
||||||
AC_MSG_CHECKING([for __progname])
|
AC_MSG_CHECKING([for __progname])
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_PROGRAM([[]],
|
[AC_LANG_PROGRAM([[extern char *__progname;]],
|
||||||
[[extern char *__progname;
|
[[printf("%s", __progname);]])],
|
||||||
const char *p = __progname;]])],
|
|
||||||
[AC_DEFINE([HAVE___PROGNAME], [1], [Define to 1 if you have __progname])
|
[AC_DEFINE([HAVE___PROGNAME], [1], [Define to 1 if you have __progname])
|
||||||
AC_MSG_RESULT([yes])],
|
AC_MSG_RESULT([yes])],
|
||||||
[AC_MSG_RESULT([no])])
|
[AC_MSG_RESULT([no])])
|
||||||
|
Loading…
Reference in New Issue
Block a user