Percona Server with XtraDB

Windows warnings comparing HANDLE and -1

Reported by Vladislav Vaintroub on 2013-03-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Low
Laurynas Biveinis
5.5
Low
Laurynas Biveinis
5.6
Low
Laurynas Biveinis

Bug Description

Recently merged XtraDB into MariDB 5.5 brings several new warnings (I checked with VS2012, perhaps it happens elsewhere, too)

37>..\..\..\storage\xtradb\log\log0online.c(547): warning C4047: '=' : 'HANDLE' differs in levels of indirection from 'int'
37>..\..\..\storage\xtradb\log\log0online.c(566): warning C4047: '!=' : 'HANDLE' differs in levels of indirection from 'int'
37>..\..\..\storage\xtradb\log\log0online.c(568): warning C4047: '=' : 'HANDLE' differs in levels of indirection from 'int'
37>..\..\..\storage\xtradb\log\log0online.c(765): warning C4047: '!=' : 'HANDLE' differs in levels of indirection from 'int'
37>..\..\..\storage\xtradb\log\log0online.c(767): warning C4047: '=' : 'HANDLE' differs in levels of indirection from 'int'
37>..\..\..\storage\xtradb\log\log0online.c(1669): warning C4047: '=' : 'HANDLE' differs in levels of indirection from 'int'

Looking at lines in question, those are all places that assign os_file_t value -1 or compare os_file_t with -1. However, on Windows os_file_t is HANDLE and HANDLE is basically void*, so comparison like that is invalid.

INVALID_HANDLE_VALUE sounds like a good candidate instead of -1. Maybe, XtraDB can use macros/inline functions like is_valid() or invalidate() to check or assign file handle values (or anything else that would avoid this type of warning in the future)

tags: added: bitmap
tags: added: xtradb
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers