<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><blockquote class=""><div class="">On 12 May 2017, at 15:29, Frediano Ziglio <<a href="mailto:fziglio@redhat.com" class="" target="_blank">fziglio@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><blockquote class=""><br class="Apple-interchange-newline">On 11 May 2017, at 12:56, Daniel P. Berrange <<a href="mailto:berrange@redhat.com" class="" target="_blank">berrange@redhat.com</a>> wrote:<br class=""><br class="">On Thu, May 11, 2017 at 12:47:08PM +0200, Christophe de Dinechin wrote:<br class=""><blockquote class="">From: Christophe de Dinechin <<a href="mailto:dinechin@redhat.com" class="" target="_blank">dinechin@redhat.com</a>><br class=""><br class="">Signed-off-by: Christophe de Dinechin <<a href="mailto:dinechin@redhat.com" class="" target="_blank">dinechin@redhat.com</a>><br class="">---<br class="">configure.ac | 14 ++++++++++++++<br class="">1 file changed, 14 insertions(+)<br class=""><br class="">diff --git a/configure.ac b/configure.ac<br class="">index 74b5811..ecab365 100644<br class="">--- a/configure.ac<br class="">+++ b/configure.ac<br class="">@@ -62,6 +62,18 @@ esac<br class="">AC_MSG_RESULT([$os_win32])<br class="">AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])<br class=""><br class="">+AC_MSG_CHECKING([for native macOS])<br class="">+case "$host_os" in<br class="">+ *darwin*)<br class="">+ os_mac=yes<br class="">+ ;;<br class="">+ *)<br class="">+ os_mac=no<br class="">+ ;;<br class="">+esac<br class="">+AC_MSG_RESULT([$os_mac])<br class="">+AM_CONDITIONAL([OS_MAC],[test "$os_mac" = "yes"])<br class="">+<br class="">AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h])<br class="">AC_CHECK_HEADERS([termios.h])<br class="">AC_CHECK_HEADERS([epoxy/egl.h],<br class="">@@ -468,6 +480,8 @@ esac<br class="">if test "$with_coroutine" = "auto"; then<br class=""> if test "$os_win32" = "yes"; then<br class=""> with_coroutine=winfiber<br class="">+ elif test "$os_mac" = "yes"; then<br class="">+ with_coroutine=gthread<br class=""> else<br class=""> with_coroutine=ucontext<br class=""> fi<br class=""></blockquote><br class="">Despite ucontext being deprecated we are still better off using that &<br class="">ignoring the warnings, than using the gthread impl.<br class=""></blockquote><br class="">Yes, I remember you explained the benefits of keeping ucontext. But for the<br class="">moment at least, on macOS, it is not a warning:<br class=""><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/ucontext.h:43:2:<br class="">error:<br class=""> The deprecated ucontext routines require _XOPEN_SOURCE to be defined<br class="">#error The deprecated ucontext routines require _XOPEN_SOURCE to be defined<br class="">^<br class="">1 error generated.<br class=""><br class="">So I can:<br class="">- Add the error in the patch description<br class="">- Attempt to define _XOPEN_SOURCE in the configuration. I’m concerned about<br class="">side effects.<br class=""><br class="">The latter leads to another can of worms. Notably, the macro container_of<br class="">triggers the alignment warning for container_of, so I have a set of<br class="">alignment warnings, and a set of deprecation warnings. But it builds. The<br class="">incremental patch would be something like:<br class=""><br class=""><br class="">diff --git a/configure.ac b/configure.ac<br class="">index ecab365..8b433ba 100644<br class="">--- a/configure.ac<br class="">+++ b/configure.ac<br class="">@@ -481,7 +481,8 @@ if test "$with_coroutine" = "auto"; then<br class=""> if test "$os_win32" = "yes"; then<br class=""> with_coroutine=winfiber<br class=""> elif test "$os_mac" = "yes"; then<br class="">- with_coroutine=gthread<br class="">+ with_coroutine=ucontext<br class="">+ AC_DEFINE([_XOPEN_SOURCE], [1], [Define _XOPEN_SOURCE on macOS for<br class="">ucontext])<br class=""> else<br class=""> with_coroutine=ucontext<br class=""> fi<br class="">diff --git a/src/continuation.h b/src/continuation.h<br class="">index 675a257..cbca06e 100644<br class="">--- a/src/continuation.h<br class="">+++ b/src/continuation.h<br class="">@@ -49,7 +49,7 @@ int cc_swap(struct continuation *from, struct continuation<br class="">*to);<br class=""><br class="">#define offset_of(type, member) ((unsigned long)(&((type *)0)->member))<br class="">#define container_of(obj, type, member) \<br class="">- (type *)(((char *)obj) - offset_of(type, member))<br class="">+ (type *)(void *)(((char *)obj) - offset_of(type, member))<br class=""><br class="">#endif<br class="">/*<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This change is ok. If it was a member of a structure surely the</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">structure must be aligned, if not the code that allocated the structure</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">is broken, not container_of.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Wondering why this change is needed. Maybe code using ucontext is</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">causing it?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></div></blockquote><div><br class=""></div><div>It’s another case that triggers the “cast changes alignment” warning. The correct fix is a SPICE_ALIGNED_CAST.</div></div></blockquote><div><br></div><div>I would go then with 3 macros instead of two<br></div><div><br></div><div>SPICE_ALIGNED_CAST, SPICE_UNALIGNED_CAST. We know if is aligned or not and we just make the cast, no additional checks.<br></div><div>SPICE_ALIGNED_CHECK_CAST. We are not sure and we do the check giving warning<br></div><div><br></div><div>How does it sound?<br></div><div><br></div><div>Frediano<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><div><br class=""></div><div>Christophe</div><div><br class=""></div><br class=""><blockquote class=""><div class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Would that be better in your opinion?<br class=""><br class=""><br class="">Christophe<br class=""><br class=""><blockquote class=""><br class="">Regards,<br class="">Daniel<br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Frediano</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Spice-devel mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Spice-devel@lists.freedesktop.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" target="_blank">Spice-devel@lists.freedesktop.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" target="_blank">https://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br data-mce-bogus="1"></div></div></blockquote></div><br class=""></blockquote><div><br></div></div></body></html>