Bugs item #1388014, was opened at 2005-12-22 14:29
Message generated for change (Comment added) made by syntheticpp
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=396644&aid=1388014&group_id=29557
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Peter Kümmel (syntheticpp)
Summary: SafeFormat tests don't pass on AMD64
Initial Comment:
The SafeFormat testsuite doesn't pass on AMD64 (with
gcc 3.4.4 at least), apparently because of assumptions
about the type of size_t
----------------------------------------------------------------------
>Comment By: Peter Kümmel (syntheticpp)
Date: 2005-12-27 19:26
Message:
Logged In: YES
user_id=1159765
fixed:
Modified Files:
SafeFormat.h
Log Message:
fix 64bit pointer problem, and remove a msvc warning
Index: SafeFormat.h
===================================================================
RCS file: /cvsroot/loki-lib/loki/include/loki/SafeFormat.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- SafeFormat.h 30 Oct 2005 14:03:23 -0000 1.5
+++ SafeFormat.h 27 Dec 2005 18:19:23 -0000 1.6
@@ -152,7 +152,7 @@
ReadLeaders();
const char fmt = *format_;
if (fmt == 'p') {
-
FormatWithCurrentFlags(reinterpret_cast<unsigned long>(s));
+
FormatWithCurrentFlags(reinterpret_cast<uintptr_t>(s));
return *this;
}
if (fmt != 's') {
@@ -176,7 +176,7 @@
}
PrintfState& operator()(const void *const p) {
- return (*this)(reinterpret_cast<unsigned long>(p));
+ return (*this)(reinterpret_cast<uintptr_t>(p));
}
// read the result
@@ -185,6 +185,7 @@
}
private:
+ PrintfState& operator=(const PrintfState&);
template <typename T>
PrintfState& StoreCountHelper(T *const pi) {
if (result_ == -1) return *this; // don't even bother
----------------------------------------------------------------------
Comment By: Zak Kipling (zak-k)
Date: 2005-12-22 14:35
Message:
Logged In: YES
user_id=764271
Compile error output:
make[1]: Entering directory
`/home/zak/src/loki-0.1.2/test/SafeFormat'
g++ -c main.cpp -o main.o -I./../../include -O2 -DNDEBUG
./../../include/loki/SafeFormat.h: In member function `void
PrintfState<Device, Char>::ReadWidth() [with Device = FILE*,
Char = char]':
./../../include/loki/SafeFormat.h:98: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(long unsigned int) [with Device = FILE*,
Char = char]'
./../../include/loki/SafeFormat.h:82: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(int) [with Device = FILE*, Char = char]'
main.cpp:104: instantiated from here
./../../include/loki/SafeFormat.h:423: error: no matching
function for call to `PrintfState<FILE*,
char>::ParseDecimalUInt(size_t&)'
./../../include/loki/SafeFormat.h:410: note: candidates are:
void PrintfState<Device, Char>::ParseDecimalUInt(unsigned
int&) [with Device = FILE*, Char = char]
./../../include/loki/SafeFormat.h: In member function `void
PrintfState<Device, Char>::ReadPrecision() [with Device =
FILE*, Char = char]':
./../../include/loki/SafeFormat.h:108: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(long unsigned int) [with Device = FILE*,
Char = char]'
./../../include/loki/SafeFormat.h:82: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(int) [with Device = FILE*, Char = char]'
main.cpp:104: instantiated from here
./../../include/loki/SafeFormat.h:429: error: no matching
function for call to `PrintfState<FILE*,
char>::ParseDecimalUInt(size_t&)'
./../../include/loki/SafeFormat.h:410: note: candidates are:
void PrintfState<Device, Char>::ParseDecimalUInt(unsigned
int&) [with Device = FILE*, Char = char]
./../../include/loki/SafeFormat.h: In member function `void
PrintfState<Device, Char>::ReadWidth() [with Device =
std::string&, Char = char]':
./../../include/loki/SafeFormat.h:98: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(long unsigned int) [with Device =
std::string&, Char = char]'
./../../include/loki/SafeFormat.h:82: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(int) [with Device = std::string&, Char =
char]'
main.cpp:57: instantiated from `void TestCase(const
std::string&, T) [with T = int]'
main.cpp:155: instantiated from here
./../../include/loki/SafeFormat.h:423: error: no matching
function for call to `PrintfState<std::string&,
char>::ParseDecimalUInt(size_t&)'
./../../include/loki/SafeFormat.h:410: note: candidates are:
void PrintfState<Device, Char>::ParseDecimalUInt(unsigned
int&) [with Device = std::string&, Char = char]
./../../include/loki/SafeFormat.h: In member function `void
PrintfState<Device, Char>::ReadPrecision() [with Device =
std::string&, Char = char]':
./../../include/loki/SafeFormat.h:108: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(long unsigned int) [with Device =
std::string&, Char = char]'
./../../include/loki/SafeFormat.h:82: instantiated from
`PrintfState<Device, Char>& PrintfState<Device,
Char>::operator()(int) [with Device = std::string&, Char =
char]'
main.cpp:57: instantiated from `void TestCase(const
std::string&, T) [with T = int]'
main.cpp:155: instantiated from here
./../../include/loki/SafeFormat.h:429: error: no matching
function for call to `PrintfState<std::string&,
char>::ParseDecimalUInt(size_t&)'
./../../include/loki/SafeFormat.h:410: note: candidates are:
void PrintfState<Device, Char>::ParseDecimalUInt(unsigned
int&) [with Device = std::string&, Char = char]
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
`/home/zak/src/loki-0.1.2/test/SafeFormat'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=396644&aid=1388014&group_id=29557
|