Bug #31466 Compiler warnings when building on Windows
Submitted: 8 Oct 2007 20:03 Modified: 9 Oct 2007 17:36
Reporter: Hakan Küçükyılmaz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:6.0, 6.0-falcon OS:Windows
Assigned to: Hakan Küçükyılmaz CPU Architecture:Any

[8 Oct 2007 20:03] Hakan Küçükyılmaz
Description:
We get new compiler warnings when building on Windows.

How to repeat:
See Pushbuild of mysql-6.0-falcon for 'vm-win2003-32-a' Win32 VS2003 -max-nt

ha_falcon/ha_falcon.cpp: 566
	C4244: '=' : conversion from 'ha_rows' to 'ulong', possible loss of data
ha_falcon/ha_falcon.cpp: 1467
	C4244: 'return' : conversion from 'ha_rows' to 'double', possible loss of data
mysqld/sql_select.cc: 5403
	C4244: '=' : conversion from 'ha_rows' to 'double', possible loss of data
mysqld/opt_range.cc: 7971
	C4244: 'argument' : conversion from 'ha_rows' to 'uint', possible loss of data
mysqld/handler.cc: 3210
	C4244: 'argument' : conversion from 'ha_rows' to 'double', possible loss of data
mysqld/handler.cc: 3922
	C4244: '=' : conversion from 'ha_rows' to 'double', possible loss of data
mysqld/handler.cc: 3925
	C4244: 'argument' : conversion from 'ha_rows' to 'double', possible loss of data
mysqld/handler.cc: 4020
	C4244: 'argument' : conversion from 'ha_rows' to 'uint', possible loss of data
[9 Oct 2007 0:51] MySQL Verification Team
Thank you for the bug report.

1>------ Build started: Project: ha_falcon, Configuration: Release x64 ------
1>Compiling...
1>ha_falcon.cpp
1>c:\dev\mysql-5.1-falcon\sql\item.h(1033) : warning C4267: 'argument' : conversion from 'size_t' to 'uint', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\spatial.h(284) : warning C4267: 'initializing' : conversion from 'size_t' to 'uint32', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\sql_lex.h(1340) : warning C4244: 'return' : conversion from '__int64' to 'uint', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\sql_class.h(1821) : warning C4267: '=' : conversion from 'size_t' to 'uint', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\sql_class.h(1827) : warning C4267: '=' : conversion from 'size_t' to 'uint', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\log_event.h(2092) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>c:\dev\mysql-5.1-falcon\sql\log_event.h(2660) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>.\ha_falcon.cpp(180) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>.\ha_falcon.cpp(248) : warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data
1>.\ha_falcon.cpp(276) : warning C4244: 'return' : conversion from '__int64' to 'uint', possible loss of data
1>.\ha_falcon.cpp(2299) : warning C4267: 'argument' : conversion from 'size_t' to 'uint32', possible loss of data
1>.\ha_falcon.cpp(2302) : warning C4267: 'argument' : conversion from 'size_t' to 'uint32', possible loss of data
1>Build log was saved at "file://c:\dev\mysql-5.1-falcon\storage\falcon\ha_falcon.dir\Release\BuildLog.htm"
1>ha_falcon - 0 error(s), 12 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
[9 Oct 2007 5:49] Hakan Küçükyılmaz
The compiler warnings show up due to setting BIG_TABLE per default in
  include/config-win.h

This has a side effect in
  include/my_base.h

/* For number of records */
#ifdef BIG_TABLES
#define rows2double(A)	ulonglong2double(A)
typedef my_off_t	ha_rows;
#else
#define rows2double(A)	(double) (A)
typedef ulong		ha_rows;
#endif

Now ha_rows has become my_off_t and before it was ulong.

Best regards,

Hakan
[9 Oct 2007 7:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35166

ChangeSet@1.2625, 2007-10-09 09:21:21+02:00, hakank@lu0011.(none) +4 -0
  Fix compiler warnings (Bug#31466).
[9 Oct 2007 17:36] Hakan Küçükyılmaz
Warnings are fixed now