On 2012-06-06 00:07, Sevan / Venture37 wrote:
> Buildworld completes successfully with ccache switched off, it fails 
> otherwise, system was built WITH_CLANG_IS_CC previously.
...
> In file included from /usr/src/lib/libc/net/getaddrinfo.c:1:
> /usr/src/lib/libc/net/getaddrinfo.c:467:15: error: explicitly assigning 
> a variable of type 'int' to itself [-Werror,-Wself-assign]
>     do { error = (error); goto bad; } while ( 0);
>          ~~~~~ ^  ~~~~~

This is because clang suppresses a number of warnings for specific
patterns in macros.  Since ccache passes clang the preprocessed file,
those suppressions will not work, and some additional warnings can be
triggered.

See also the following threads on the cfe-dev mailing list:

  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-September/017250.html
  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/021824.html

That said, I had a look at the specific warnings you posted for libc,
and they are easy enough to fix.  Please try the attached patch.
Index: lib/libc/include/port_before.h
===================================================================
--- lib/libc/include/port_before.h	(revision 236667)
+++ lib/libc/include/port_before.h	(working copy)
@@ -17,6 +17,6 @@
                 var = _u.v; \
         } while (0)
 
-#define UNUSED(x) (x) = (x)
+#define UNUSED(x) (void)(x)
 
 #endif /* _PORT_BEFORE_H_ */
Index: lib/libc/net/getaddrinfo.c
===================================================================
--- lib/libc/net/getaddrinfo.c	(revision 236667)
+++ lib/libc/net/getaddrinfo.c	(working copy)
@@ -464,7 +464,7 @@ getaddrinfo(const char *hostname, const char *serv
 		}
 		error = get_portmatch(pai, servname);
 		if (error)
-			ERR(error);
+			goto bad;
 
 		*pai = ai0;
 	}
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to