* [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms
@ 2018-10-30 14:36 Theodore Ts'o
2018-10-30 15:02 ` Bart Van Assche
0 siblings, 1 reply; 4+ messages in thread
From: Theodore Ts'o @ 2018-10-30 14:36 UTC (permalink / raw)
To: linux-block; +Cc: Theodore Ts'o
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
src/discontiguous-io.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
index 5e0ee0f..f51a305 100644
--- a/src/discontiguous-io.cpp
+++ b/src/discontiguous-io.cpp
@@ -251,7 +251,7 @@ int main(int argc, char **argv)
const char *dev;
int c;
std::vector<uint8_t> buf;
- size_t len = 512;
+ unsigned long len = 512;
while ((c = getopt(argc, argv, "hl:o:sw")) != EOF) {
switch (c) {
--
2.18.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms
2018-10-30 14:36 [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms Theodore Ts'o
@ 2018-10-30 15:02 ` Bart Van Assche
2018-10-30 16:02 ` Theodore Y. Ts'o
0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2018-10-30 15:02 UTC (permalink / raw)
To: Theodore Ts'o, linux-block
On Tue, 2018-10-30 at 10:36 -0400, Theodore Ts'o wrote:
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> src/discontiguous-io.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
> index 5e0ee0f..f51a305 100644
> --- a/src/discontiguous-io.cpp
> +++ b/src/discontiguous-io.cpp
> @@ -251,7 +251,7 @@ int main(int argc, char **argv)
> const char *dev;
> int c;
> std::vector<uint8_t> buf;
> - size_t len = 512;
> + unsigned long len = 512;
>
> while ((c = getopt(argc, argv, "hl:o:sw")) != EOF) {
> switch (c) {
Details about how the build fails on 32-bit systems would have been welcome
in the commit message. Anyway:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms
2018-10-30 15:02 ` Bart Van Assche
@ 2018-10-30 16:02 ` Theodore Y. Ts'o
2018-10-30 17:19 ` Bart Van Assche
0 siblings, 1 reply; 4+ messages in thread
From: Theodore Y. Ts'o @ 2018-10-30 16:02 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-block
On Tue, Oct 30, 2018 at 08:02:55AM -0700, Bart Van Assche wrote:
> Details about how the build fails on 32-bit systems would have been welcome
> in the commit message. Anyway:
>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
For the record, here's the failure. It's the usual incomprehensible
C++ error reporting. :-)
% schroot -c stretch-i386 -- ./build-all --blktests-only
----------------- 2018-10-30 16:00:18: Starting build of blktests
make -C src all
make[1]: Entering directory '/usr/projects/xfstests-bld/build-32/blktests/src'
g++ -O2 -std=c++11 -Wall -Wextra -Wno-sign-compare -Werror -o discontiguous-io discontiguous-io.cpp
discontiguous-io.cpp: In function 'int main(int, char**)':
discontiguous-io.cpp:294:34: error: no matching function for call to 'min(long unsigned int, size_t)'
std::min(4ul, len - i * 4));
^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/string:40,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/iomanip:40,
from discontiguous-io.cpp:8:
/usr/include/c++/6/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/6/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
discontiguous-io.cpp:294:34: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'size_t {aka unsigned int}')
std::min(4ul, len - i * 4));
^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/string:40,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/iomanip:40,
from discontiguous-io.cpp:8:
/usr/include/c++/6/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
discontiguous-io.cpp:294:34: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'size_t {aka unsigned int}')
std::min(4ul, len - i * 4));
^
Makefile:27: recipe for target 'discontiguous-io' failed
make[1]: *** [discontiguous-io] Error 1
make[1]: Leaving directory '/usr/projects/xfstests-bld/build-32/blktests/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms
2018-10-30 16:02 ` Theodore Y. Ts'o
@ 2018-10-30 17:19 ` Bart Van Assche
0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-10-30 17:19 UTC (permalink / raw)
To: Theodore Y. Ts'o; +Cc: linux-block
On Tue, 2018-10-30 at 12:02 -0400, Theodore Y. Ts'o wrote:
> On Tue, Oct 30, 2018 at 08:02:55AM -0700, Bart Van Assche wrote:
> > Details about how the build fails on 32-bit systems would have been welcome
> > in the commit message. Anyway:
> >
> > Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>
> For the record, here's the failure. It's the usual incomprehensible
> C++ error reporting. :-)
>
> [ ... ]
> discontiguous-io.cpp: In function 'int main(int, char**)':
> discontiguous-io.cpp:294:34: error: no matching function for call to 'min(long unsigned int, size_t)'
> std::min(4ul, len - i * 4));
> ^
> [ ... ]
Thanks Ted for having provided the full compiler output. However, I don't
think that the entire error message should go in the commit message. To me,
the part of the compiler error message I cited tells the whole story :-)
Bart.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-31 2:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 14:36 [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms Theodore Ts'o
2018-10-30 15:02 ` Bart Van Assche
2018-10-30 16:02 ` Theodore Y. Ts'o
2018-10-30 17:19 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.