<html><head></head><body bgcolor="#FFFFFF"><div><br><br>Sent from my iPhone...</div><div><br>On Dec 20, 2011, at 5:58, Gaetan Nadon &lt;<a href="mailto:memsize@videotron.ca">memsize@videotron.ca</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>


  <meta http-equiv="Content-Type" content="text/html; CHARSET=UTF-8">
  <meta name="GENERATOR" content="GtkHTML/3.32.2">


On Mon, 2011-12-19 at 18:50 -0800, Jeremy Huddleston wrote:
<blockquote type="CITE">
<pre>Provide end users with a workaround if they find code doesn't build with
the -Werror=... flags provided by BASE_CFLAGS.  This can be useful if
newer util-macros are used with older source code that had problems, or
in the rare case when warnings are expanded to hit more cases (although
this case should not happen too much in practice).

Signed-off-by: Jeremy Huddleston &lt;<a href="mailto:jeremyhu@apple.com">jeremyhu@apple.com</a>&gt;
---
 xorg-macros.m4.in |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index d9ed137..22f537b 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1520,6 +1520,12 @@ m4_foreach([flag], m4_cdr($@), [
 AC_DEFUN([XORG_COMPILER_FLAGS], [
 AC_REQUIRE([XORG_COMPILER_BRAND])
 
+AC_ARG_ENABLE(selective-werror,
+              AS_HELP_STRING([--disable-selective-werror],
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Turn off selective compiler errors, please report bugs if you find you need to use this. (default: enabled)]),
</pre>
</blockquote>
Help text not appropriate, please remove "please report bugs..." Read on for an alternative.
<blockquote>
<pre>&nbsp; --disable-selective-werror
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Turn off selective compiler errors, please report
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bugs if you find you need to use this. (default:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enabled)
&nbsp; --disable-selective-werror
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Turn off selective compiler errors (default: enabled)
</pre>
</blockquote>
<br>
One question: if both --disable-selective-werror and --enable-strict-compilation are used together, does the resulting behavior make sense? Which one overrides the other, if any?<br>
<br></div></blockquote><div><br></div>well the use case doesnt make sense ... but the behavior does ... the -Werror=... become -W... and -Werror is added , so strict behaviorially overrides it.<br><blockquote type="cite"><div>
<blockquote type="CITE">
<pre>+              [SELECTIVE_WERROR=$enableval],
+              [SELECTIVE_WERROR=yes])
+
 # -v is too short to test reliably with XORG_TESTSET_CFLAG
 if test "x$SUNCC" = "xyes"; then
     BASE_CFLAGS="-v"
@@ -1557,6 +1563,8 @@ XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wredundant-decls])
 
 # Turn some warnings into errors, so we don't accidently get successful builds
 # when there are problems that should be fixed.
+
+if test "x$SELECTIVE_WERROR" = "xyes" ; then
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=nonnull])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=init-self])
@@ -1570,6 +1578,21 @@ XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=write-strings])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=address])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
+else
</pre>
</blockquote>
Consider adding AC_MSG_WARN to replace help text above. It will show up in the log for all to see. You can use $PACKAGE_BUGREPORT to provide URL. <br>
This is what we do for other situations where a module configuration is questionable but not in error.<br>
We are in the warning business :-)<br></div></blockquote><div><br></div>ok<div><br><blockquote type="cite"><div>
<br>


</div></blockquote></div></body></html>