[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-list
Subject:    Fix problems compiling oprofile with mainline gcc
From:       Duncan Simpson <dps () simpson ! demon ! co ! uk>
Date:       2009-05-30 17:29:54
Message-ID: 4A216D12.3070701 () simpson ! demon ! co ! uk
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The new version of libstdc++ in mainline gcc does not include any
standard C header files. Some older versions of libstdc++ might
automagically include some of the required C header files, so bugs that
fail to include required C header files might be hidden.

As a minor points of style it is usually better to include system headers
before package headers, with the possible exception of config.h if this
contains the results of autoconf tests for headers,

libabi/tests/abi_test.cpp fails to include <cstdlib> and <cerrno> headers.
#incluide <cstring> is required for strerror and #include <errno> is
probably a good idea in any C++ source file is aware of the errno variable.

libabi/tests/abi_test.cpp, libregex/tests/java_test.cpp and
libregex/tests/regex_test.cpp all uses the exit(3) function but fail to
include <cstdlib> so never see the proper declaration of it.

The patch at the bottom of this email fixes all these problems.

Signed-off-by: Duncan Simpson <dps@simpson.demon.co.uk>
Duncan (-:

- --- oprofile-0.9.4/ChangeLog    2008-07-18 00:04:22.000000000 +0100
+++ oprofile-0.9.4.new/ChangeLog        2009-05-30 16:55:04.055720953 +0100
@@ -1,3 +1,9 @@
+2009-05-30  Duncan Simpson <dps@simpson.demon.co.uk>
+
+       * libabi/tests/abi_test.cpp: #include <cerrno>, <cstring> and <cstdlib>
+       * libregex/tests/java_test.cpp: Add required #inlcude <cstdlib>
+       * libregex/tests/regex_test.cpp: Add required #inlcude <cstdlib>
+
~ 2008-07-17  Maynard Johnson  <maynardj@us.ibm.com>

~        * configure.in: bump version in AM_INIT_AUTOMAKE to 0.9.4
diff -paurN oprofile-0.9.4/libabi/tests/abi_test.cpp oprofile-0.9.4.new/libabi/tests/abi_test.cpp
- --- oprofile-0.9.4/libabi/tests/abi_test.cpp    2005-08-17 20:15:42.000000000 +0100
+++ oprofile-0.9.4.new/libabi/tests/abi_test.cpp        2009-05-26 04:11:50.951275089 +0100
@@ -15,6 +15,9 @@
~ #include "op_cpu_type.h"
~ #include "op_config.h"

+#include <cerrno>
+#include <cstring>
+#include <cstdlib>
~ #include <fstream>
~ #include <iostream>

diff -paurN oprofile-0.9.4/libregex/tests/java_test.cpp oprofile-0.9.4.new/libregex/tests/java_test.cpp
- --- oprofile-0.9.4/libregex/tests/java_test.cpp 2008-04-28 22:23:24.000000000 +0100
+++ oprofile-0.9.4.new/libregex/tests/java_test.cpp     2009-05-26 04:15:27.747788505 +0100
@@ -14,6 +14,7 @@

~ #include "op_regex.h"

+#include <cstdlib>
~ #include <iostream>
~ #include <fstream>

diff -paurN oprofile-0.9.4/libregex/tests/regex_test.cpp oprofile-0.9.4.new/libregex/tests/regex_test.cpp
- --- oprofile-0.9.4/libregex/tests/regex_test.cpp        2005-08-07 12:15:52.000000000 +0100
+++ oprofile-0.9.4.new/libregex/tests/regex_test.cpp    2009-05-26 04:13:35.751287945 +0100
@@ -18,6 +18,7 @@

~ #include "op_regex.h"

+#include <cstdlib>
~ #include <iostream>
~ #include <fstream>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkohbRIACgkQ/ztdQuNQ8m3PwwCgzvgDS1+M10qvQRube54epS2U
dkkAoLQ7Wi8r3mwdPf8ag4dmkh7U7ub7
=PHoW
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic