Bug 110408 - SRPMS: deprecated construct is used in source â probably just a typo
Summary: SRPMS: deprecated construct is used in source â probably just a typo
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: oprofile
Version: 3.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: William Cohen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-19 09:37 UTC by Sysoltsev Slawa
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-11-19 16:27:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sysoltsev Slawa 2003-11-19 09:37:00 UTC
Description of problem:
trying âmake checkâ in oprofile source root Iâve got a message from my 
compiler:

Making check in libregex
make[1]: Entering directory 
`/mnt/sdb1/users/vsysoltx/tc_8/WORK_DIR/BUILD/oprofile-
0.5.4/libregex'
source='op_regex.cpp' object='op_regex.o' libtool=no \
depfile='.deps/op_regex.Po' tmpdepfile='.deps/op_regex.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
icpc -DHAVE_CONFIG_H -I. -I. -I..  -I ../libutil++  -W -fno-common -g -
O2 -c -o op_regex.o `test -f 'op_regex.cpp' || echo './'`op_regex.cpp
icpc: Command line remark: option '-W' not supported
icpc: Command line remark: option '-MP' not supported
op_regex.cpp(26): error: overloaded function "bad_regex::bad_regex" 
cannot be defined in the current scope
  bad_regex::bad_regex(string const & pattern)
  ^

op_regex.cpp(27): error: expected a "{"
        :
        ^

op_regex.cpp(286): warning #175: subscript out of range
                                throw bad_regex("invalid input file: " +
                                                                       ^

op_regex.cpp(294): warning #175: subscript out of range
                                                + '"' + line + '"');
                                                ^

op_regex.cpp(305): warning #175: subscript out of range
                                throw bad_regex("invalid input file: " +
                                                                       ^

compilation aborted for op_regex.cpp (code 2)


There is a typo in sources I believe: bad_regex:: bad_regex is declared 
in global namespace in op_regex.h but defined in unnamed namespace 
in op_regex.cpp. Itâs definition should be moved out of the unnamed 
namespace (as regular_expression_replace members are defined 
outside of this namespace later in the file).
Here is the patch for this move:
--- libregex/op_regex.cpp.orig  2003-11-19 11:57:03.000000000 +0300
+++ libregex/op_regex.cpp       2003-11-19 12:23:42.000000000 +0300
@@ -21,14 +21,13 @@

 using namespace std;

-namespace {
-
 bad_regex::bad_regex(string const & pattern)
        :
        op_exception(pattern)
 {
 }

+namespace {

 string op_regerror(int err, regex_t const & regexp)
 {

By using standart/accustomed language constructs oprofile would get 
more portability between platforms/compiler so please consider applying 
this patch despite there is no error emitted with current version of g++ 
(3.2.3).


Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Get Intel compiler (better 8.0) anywhere
2. do 'rpm -bc' using any compiler
3. try 'make check' in source root using Intel compiler: make check 
CXX=icpc
  
Actual results:
Compile-time error

Expected results:
no compile-time errors

Additional info:

Comment 1 William Cohen 2003-11-19 16:08:53 UTC
What should be done is check the problem is still in the latest
development versions of oprofile available on
http://oprofile.sourceforge.net/ and submit a patch for it upstream.

Comment 2 Sysoltsev Slawa 2003-11-20 08:11:35 UTC
Reported upstream http://sourceforge.net/tracker/index.php?
func=detail&aid=845616&group_id=16191&atid=116191
The resolution is to be changed to "reported upstream" as well.

By the way, not deprecating the sources only gcc can compile (actually 
due to bug I believe) you stimulate the uniqueness (and therefore some 
kind of monopoly) of g++, restricting the use of another compiler; this is 
action NOT in spite of OPEN development environment for that Linux is 
so loved - this is my is personal opinion.



Note You need to log in before you can comment on or make changes to this bug.