From 76c4f4a31228b9be78458a22596c5be612de2056 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 5 Oct 2018 21:31:30 +1300 Subject: [PATCH] Suppress alignment cast warning on sparc Linux The pointer being cast is to a record returned by getdirentries(), so it should be suitable aligned. --- xapian-core/common/closefrom.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xapian-core/common/closefrom.cc b/xapian-core/common/closefrom.cc index 48514cb4c..9df3fe051 100644 --- a/xapian-core/common/closefrom.cc +++ b/xapian-core/common/closefrom.cc @@ -1,7 +1,7 @@ /** @file closefrom.cc * @brief Implementation of closefrom() function. */ -/* Copyright (C) 2010,2011,2012,2016 Olly Betts +/* Copyright (C) 2010,2011,2012,2016,2018 Olly Betts * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #endif #if defined __linux__ +# include "alignment_cast.h" # include "safedirent.h" # include #elif defined __APPLE__ @@ -112,7 +113,7 @@ Xapian::Internal::closefrom(int fd) } struct dirent *d; for (ssize_t pos = 0; pos < c; pos += d->d_reclen) { - d = reinterpret_cast(buf + pos); + d = alignment_cast(buf + pos); const char * leaf = d->d_name; if (leaf[0] < '0' || leaf[0] > '9') { // Skip '.' and '..'. -- 2.11.4.GIT