<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - I can't build poppler with Clang"
href="https://bugs.freedesktop.org/show_bug.cgi?id=76963#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - I can't build poppler with Clang"
href="https://bugs.freedesktop.org/show_bug.cgi?id=76963">bug 76963</a>
from <span class="vcard"><a class="email" href="mailto:dmacks@netspace.org" title="Daniel Macks <dmacks@netspace.org>"> <span class="fn">Daniel Macks</span></a>
</span></b>
<pre>The following seems to work:
AC_MSG_CHECKING([for -fno-check-new compiler flag])
AC_LANG_PUSH([C++])
saved_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-fno-check-new $CXXFLAGS"
AC_TRY_COMPILE([], [],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
CXXFLAGS=$saved_CXXFLAGS
AC_LANG_POP
I'll be happy to provide a patch against current git, but there are two
approaches. Reason I ask is that the flag is only *sometimes* added, via
various branches of a case statement beginning at line 814.
1. Do this test (always) and store the result in a temp variable, and then use
that result to control whether the flag is propagated in the branches where it
was previously hardcoded to add.
2. Do this test and propagate the flag only in the branches where it is
currently hardcoded to use.
The tradeoff is that option 1 avoids duplicating the test code itself (less
fragile if the case logic changes) but means the test is run even in situations
where its results would be ignored. Please let me know which approach you would
prefer (or some other approach altogether).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>