[mythtv-commits] Ticket #5178: class scoping directive for constructors is confusing to the compiler

MythTV mythtv at cvs.mythtv.org
Tue Apr 8 15:17:42 UTC 2008


#5178: class scoping directive for constructors is confusing to the compiler
---------------------------------------------+------------------------------
 Reporter:  Erik Hovland <erik at hovland.org>  |       Owner:  ijr    
     Type:  defect                           |      Status:  new    
 Priority:  trivial                          |   Milestone:  unknown
Component:  mythtv                           |     Version:  head   
 Severity:  low                              |     Mlocked:  0      
---------------------------------------------+------------------------------
 Unfortunately using the class as a scoping directive to a constructor is
 ambiguous in the C++ standard. So using it makes the compiler work harder.
 For example:
 {{{ QTime epoch = QTime::QTime(1970, 1, 1);}}}

 The 'correct solution is to drop the class part of the call:
 {{{ QTime epoch(1970, 1, 1);}}}

 g++ is smart enough to understand what you mean when you use the scoping
 directive. But it can waste memory and can have trouble emitting
 information about the functions these sorts of calls are in. This means
 that static analysis tools may not be able to analyze the functions that
 these calls show up in. Which means that if there are defects in these
 functions they are not known.

 I have prepared patches for each directory that these issues show up in
 and I am attaching them to this ticket.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/5178>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list