I tried to build Xen from the git repository, cloning the RELEASE-4.2.2 tag, on a NetBSD 6.0.1 system installed on an i386 host. I got 4 warnings, causing the compilation to fail, due to the -Werror flag. Rather than removing the flag, I did prefer to patch the source, since the fix was really trivial. Please find the patch attached. Regards, 7heo. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
On Thu, 2013-04-25 at 15:48 +0100, 7heo@7heo.tk wrote:> I tried to build Xen from the git repository, > cloning the RELEASE-4.2.2 tag, on a NetBSD > 6.0.1 system installed on an i386 host. > > I got 4 warnings, causing the compilation to > fail, due to the -Werror flag. > > Rather than removing the flag, I did prefer to > patch the source, since the fix was really > trivial. > > Please find the patch attached.Thanks. It really seems like casting is the only reliable way to print a time_t :-/ Please could you resubmit with a Signed-off-by as described in: http://wiki.xen.org/wiki/Submitting_Xen_Patches Also, patches need to be applied to xen-unstable before being backported to the stable branches (otherwise 4.3 will simply regress again, http://wiki.xen.org/wiki/Xen_Maintenance_Releases has some more on the topic). So, please could you send a patch against unstable, this particular piece of code doesn''t seem to have changed all that much. THanks, Ian.
>>> On 25.04.13 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote: > On Thu, 2013-04-25 at 15:48 +0100, 7heo@7heo.tk wrote: >> I tried to build Xen from the git repository, >> cloning the RELEASE-4.2.2 tag, on a NetBSD >> 6.0.1 system installed on an i386 host. >> >> I got 4 warnings, causing the compilation to >> fail, due to the -Werror flag. >> >> Rather than removing the flag, I did prefer to >> patch the source, since the fix was really >> trivial. >> >> Please find the patch attached. > > Thanks. It really seems like casting is the only reliable way to print a > time_t :-/Except that a cast to "long" here can turn out to be a truncation, so you''d really want to cast up to "long long". Jan
On Thu, Apr 25, 2013 at 04:22:02PM +0100, Jan Beulich wrote:> >>> On 25.04.13 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote: > > On Thu, 2013-04-25 at 15:48 +0100, 7heo@7heo.tk wrote: > >> I tried to build Xen from the git repository, > >> cloning the RELEASE-4.2.2 tag, on a NetBSD > >> 6.0.1 system installed on an i386 host. > >> > >> I got 4 warnings, causing the compilation to > >> fail, due to the -Werror flag. > >> > >> Rather than removing the flag, I did prefer to > >> patch the source, since the fix was really > >> trivial. > >> > >> Please find the patch attached. > > > > Thanks. It really seems like casting is the only reliable way to print a > > time_t :-/ > > Except that a cast to "long" here can turn out to be a truncation, > so you''d really want to cast up to "long long".Maybe an AC_CHECK_SIZEOF(time_t, [], [#include <time.h>]) #if SIZEOF_TIME_T == 8 #elif SIZEOF_TIME_T == 4 is also necessary? The OPs system will have a 64-bit time_t but that isn''t a given... Cheers, Patrick
On Thu, 2013-04-25 at 16:44 +0100, Patrick Welche wrote:> On Thu, Apr 25, 2013 at 04:22:02PM +0100, Jan Beulich wrote: > > >>> On 25.04.13 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote: > > > On Thu, 2013-04-25 at 15:48 +0100, 7heo@7heo.tk wrote: > > >> I tried to build Xen from the git repository, > > >> cloning the RELEASE-4.2.2 tag, on a NetBSD > > >> 6.0.1 system installed on an i386 host. > > >> > > >> I got 4 warnings, causing the compilation to > > >> fail, due to the -Werror flag. > > >> > > >> Rather than removing the flag, I did prefer to > > >> patch the source, since the fix was really > > >> trivial. > > >> > > >> Please find the patch attached. > > > > > > Thanks. It really seems like casting is the only reliable way to print a > > > time_t :-/ > > > > Except that a cast to "long" here can turn out to be a truncation, > > so you''d really want to cast up to "long long". > > Maybe an > AC_CHECK_SIZEOF(time_t, [], [#include <time.h>]) > #if SIZEOF_TIME_T == 8 > #elif SIZEOF_TIME_T == 4 > is also necessary? > > The OPs system will have a 64-bit time_t but that isn''t a given...As long as the case is to a larger type and the printf format matches I think that is fine. I don''t think any system has a >64 bit time_t? Ian.