small medium large xlarge

09 Apr 2013, 03:46
Ben Bergman (3 posts)

I’m trying to compile the example code and I’m getting some errors (probably escalated by the -Werror flag). I have tried with the code posted on this site as of 2013-04-08, CppUTest v3.3, and CppUTest master as of today’s date, and all give me the same error (using gcc 4.8.0):

src/CppUTest/MemoryLeakDetector.cpp: In member function ‘void MemoryLeakDetector::ConstructMemoryLeakReport(MemLeakPeriod)’:
src/CppUTest/MemoryLeakDetector.cpp:429:76: error: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Werror=conversion]
  output_buffer_.setWriteLimit(SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN - MEM_LEAK_NORMAL_MALLOC_FOOTER_SIZE);

Has anyone else seen this? I’m running Arch Linux 64 bit.

09 Apr 2013, 15:02
Ben Bergman (3 posts)

I just retried compiling all three versions with gcc 4.6.3 on Ubuntu 12.04 and had no errors with any of them.

09 Apr 2013, 15:04
Ben Bergman (3 posts)

I just found this article[1] on making code gcc 4.8 friendly. I might try to submit a patch, but without being able to compile cpputest, I won’t be able to test drive the patch :)


19 Aug 2013, 08:47
Wang Peng (1 post)

I also encountered this problem. I used cygwin(64bit) in Windows 7, the gcc version is 4.8.1

You must be logged in to comment