I've updated to rev. 7830 and I'm having issues compiling using 32-bit mingw:
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1032:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1033:72: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1045:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1046:72: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1056:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
Process terminated with status 1 (4 minutes, 24 seconds)
10 errors, 36 warnings (4 minutes, 24 seconds)
I'm guessing a type issue with the 64-bit modifications?
Quote from: ironhead on February 22, 2012, 02:31:47 AM
I've updated to rev. 7830 and I'm having issues compiling using 32-bit mingw:
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1032:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1033:72: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1045:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1046:72: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
C:\codeblocks\trunk\src\plugins\debuggergdb\/gdb_commands.h:1056:67: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
C:\wxWidgets-2.8.12\include/wx/string.h:1188:10: error: initializing argument 1 of 'bool wxString::ToULong(long unsigned int*, int) const' [-fpermissive]
Process terminated with status 1 (4 minutes, 24 seconds)
10 errors, 36 warnings (4 minutes, 24 seconds)
I'm guessing a type issue with the 64-bit modifications?
I got this also (win7 64-bit, but 32-bit compiler).
It comes from these changes:
http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/debuggergdb/debugger_defs.h?op=diff&rev=7828 (http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/debuggergdb/debugger_defs.h?op=diff&rev=7828)
wxString::ToULong, needs an
unsigned long * as first parameter, but gets a
size_t *.
size_t is defined as
unsigned int on 32-bit and can not guarantee to hold the conversion to
unsigned long (obviously).
Quote from: ironhead on February 22, 2012, 02:31:47 AM
I've updated to rev. 7830 and I'm having issues compiling using 32-bit mingw:
What compiler are you using?
...could you try this patch, please:
Index: src/plugins/debuggergdb/debugger_defs.h
===================================================================
--- src/plugins/debuggergdb/debugger_defs.h (revision 7830)
+++ src/plugins/debuggergdb/debugger_defs.h (working copy)
@@ -222,9 +222,13 @@
}
bool valid; ///< Is this stack frame valid?
// 64 bit compatibility: don't use unsigned long int here:
+#if defined(_WIN64)
size_t number; ///< Stack frame's number (used in backtraces).
- // ...and here:
size_t address; ///< Stack frame's address.
+#else
+ unsigned long int number; ///< Stack frame's number (used in backtraces).
+ unsigned long int address; ///< Stack frame's address.
+#endif
wxString function; ///< Current function name.
wxString file; ///< Current file.
wxString line; ///< Current line in file.
Quote from: MortenMacFly on February 22, 2012, 06:51:20 AM
...could you try this patch, please:
Index: src/plugins/debuggergdb/debugger_defs.h
===================================================================
--- src/plugins/debuggergdb/debugger_defs.h (revision 7830)
+++ src/plugins/debuggergdb/debugger_defs.h (working copy)
@@ -222,9 +222,13 @@
}
bool valid; ///< Is this stack frame valid?
// 64 bit compatibility: don't use unsigned long int here:
+#if defined(_WIN64)
size_t number; ///< Stack frame's number (used in backtraces).
- // ...and here:
size_t address; ///< Stack frame's address.
+#else
+ unsigned long int number; ///< Stack frame's number (used in backtraces).
+ unsigned long int address; ///< Stack frame's address.
+#endif
wxString function; ///< Current function name.
wxString file; ///< Current file.
wxString line; ///< Current line in file.
I did the same yesterday (without the win64 macro) and it works here (TDM MinGW 4.4 32-bit).
Quote from: MortenMacFly on February 22, 2012, 06:51:20 AM
...could you try this patch, please:
Index: src/plugins/debuggergdb/debugger_defs.h
===================================================================
--- src/plugins/debuggergdb/debugger_defs.h (revision 7830)
+++ src/plugins/debuggergdb/debugger_defs.h (working copy)
@@ -222,9 +222,13 @@
}
bool valid; ///< Is this stack frame valid?
// 64 bit compatibility: don't use unsigned long int here:
+#if defined(_WIN64)
size_t number; ///< Stack frame's number (used in backtraces).
- // ...and here:
size_t address; ///< Stack frame's address.
+#else
+ unsigned long int number; ///< Stack frame's number (used in backtraces).
+ unsigned long int address; ///< Stack frame's address.
+#endif
wxString function; ///< Current function name.
wxString file; ///< Current file.
wxString line; ///< Current line in file.
Win32 build of Code::Blocks main project compiled with the above patch did not try running or compiling contrib projects.
Tim S.
why not always have both variables being of type unsigned long ?
Quote from: killerbot on February 22, 2012, 07:43:26 AM
why not always have both variables being of type unsigned long ?
Because on 32 bit its
unsigned long int, on 64 bit its
unsigned long long (
size_t).
Quote from: stahta01 on February 22, 2012, 07:35:11 AM
did not try running or compiling contrib projects.
Contrib plugins are not yet supported for 64 bit builds, 32 bit builds should not be affected.
Quote from: MortenMacFly on February 22, 2012, 08:01:09 AM
Quote from: killerbot on February 22, 2012, 07:43:26 AM
why not always have both variables being of type unsigned long ?
Because on 32 bit its unsigned long int, on 64 bit its unsigned long long (size_t).
Why not just use size_t and leave it to the compiler to sort out? 32-bit MinGW will define size_t appropriately, as will 64-bit mingw-w64.
Quote from: MortenMacFly on February 22, 2012, 08:02:53 AM
Because on 32 bit its unsigned long int, on 64 bit its unsigned long long (size_t).
Yes, so, if I look at the ifdef posted above (note WIN64 --> what happens on linux 64 bit ??) :
if WIN64 bit --> size_t ==> 64 bits BUT unsigned long is also 64 bit on 64 bits machines
else (considering this means 32 bit !!!! ??)
unsigned long ==> 32 bits, but size_t is also 32 bits here
Meaning that either unsigned long can be used in both cases, or for that matter size_t can be used for both.
When using unsigned long for printf '%lu' can be used,
and for size_t "%zu"
Quote from: killerbot on February 22, 2012, 01:07:09 PM
and for size_t "%zu"
Uaaah - careful here, remember that this caused a silent crash? I would prefer a solution that uses a well established standard... hence I don't know any. :-(
Quote from: killerbot on February 22, 2012, 01:07:09 PM
Quote from: MortenMacFly on February 22, 2012, 08:02:53 AM
Because on 32 bit its unsigned long int, on 64 bit its unsigned long long (size_t).
Yes, so, if I look at the ifdef posted above (note WIN64 --> what happens on linux 64 bit ??) :
if WIN64 bit --> size_t ==> 64 bits BUT unsigned long is also 64 bit on 64 bits machines
else (considering this means 32 bit !!!! ??)
unsigned long ==> 32 bits, but size_t is also 32 bits here
Meaning that either unsigned long can be used in both cases, or for that matter size_t can be used for both.
When using unsigned long for printf '%lu' can be used,
and for size_t "%zu"
Win 32 -
size_t =>
unsigned long intWin 64 -
size_t =>
unsigned long long intLinux 32 & 64 bit
size_t =>
unsigned long intSo if you use
size_t it'll work on all platform. However printf format identifier will be different
only under Win 64. You have to use
%I64u printf format string to print unsigned 64 bit integer.
As far as I know size_t is usually the same as __SIZE_TYPE__
Quote from: Biplab on February 22, 2012, 02:20:45 PM
Win 32 -
size_t => unsigned long int
__SIZE_TYPE__ =>
unsigned intQuote from: Biplab on February 22, 2012, 02:20:45 PM
Win 64 -
size_t => unsigned long long int
not tested
Quote from: Biplab on February 22, 2012, 02:20:45 PM
Linux 32 & 64 bit
size_t => unsigned long int
Linux 32:
__SIZE_TYPE__ =>
unsigned intLinux 64:
__SIZE_TYPE__ =>
long unsigned int
Quote from: jens on February 22, 2012, 03:28:39 PM
As far as I know size_t is usually the same as __SIZE_TYPE__
Quote from: Biplab on February 22, 2012, 02:20:45 PM
Win 32 -
size_t => unsigned long int
__SIZE_TYPE__ => unsigned int
Quote from: Biplab on February 22, 2012, 02:20:45 PM
Win 64 -
size_t => unsigned long long int
not tested
Quote from: Biplab on February 22, 2012, 02:20:45 PM
Linux 32 & 64 bit
size_t => unsigned long int
Linux 32:
__SIZE_TYPE__ => unsigned int
Linux 64:
__SIZE_TYPE__ => long unsigned int
Win32:
sizeof(int)=sizeof(long)=sizeof(unsigned long)=4Win64:
sizeof(int)=sizeof(long)=sizeof(unsigned long)=4
sizeof(long long)=sizeof(unsigned long long)=8Linux-32-bit:
sizeof(int)=sizeof(long)=sizeof(unsigned long)=4Linux-64-bit:
sizeof(int)=4
sizeof(long)=sizeof(unsigned long)=8
I guess you're after this specs: http://en.wikipedia.org/wiki/64-bit#64-bit_data_models
Quote from: oBFusCATed on February 22, 2012, 04:59:05 PM
I guess you're after this specs: http://en.wikipedia.org/wiki/64-bit#64-bit_data_models
There are other guidelines available, too. Wikipedia one is comprehensive.
You can also read the following article.
Quotehttp://software.intel.com/en-us/articles/lessons-on-development-of-64-bit-cc-applications/
They have an nice summary about
size_t