Menu

#24 Multiple Compile Failures on g++ 4.8.2 with -Weffc++ and -Werror

v1.0 (example)
unread
mack
None
5
2014-12-03
2014-12-03
gfarrand
No

Environment
Ubuntu 14.04 LTS, with g++ version 4.8.2.

RapidXML
Version 1.13

Problem
There are a fair amount of compiler warnings that pop up with the -Weffc++ is enabled in the compiler. Anyone that promotes warnings to errors (like me) will have this get in the way.

Steps to Reproduce

  1. Create a .cpp file which #includes rapidxml.hpp, and makes very light use of any of the objects (xml_node<char>, xml_attribute<char>, etc.).</char></char>
  2. Compile that .cpp file with the following command: g++ -c -g -O0 -Weffc++ -Wall -Wextra -Werror -fno-exceptions -std=c++0x <includes> <file>.cpp -o <file>.o</file></file></includes>
  3. Note that the compile failed with a bunch of errors relating to non-virtual destructors, public default assignment operators and copy constructors for classes with pointer members, etc.

A Patch Fix
I have attached a patch to v1.13 of RapidXML to address these issues. I have only done very light testing, but these changes seem to have no functional impact.

1 Attachments

Discussion


Log in to post a comment.