Menu

const return values

Developer
DavidA
2005-09-19
2013-05-20
  • DavidA

    DavidA - 2005-09-19

    Hi

    I reported in the Open Discussion forum that I am running TinyXml on a TI DSP. A minor irritation is that the compiler issues a warning for functions such as:
      
       const int IntValue() const; 

    The warning is:
      
       "tinyxml\\tinyxml.h", line 698: warning: type qualifier on return type is meaningless
      
    I am not a C++ expert and the TI compiler may not be fully compliant, but I wonder if the compiler has a point?  Perhaps const should only be specified
    for returned pointers and references?
      
    David

     
    • Lee Thomason

      Lee Thomason - 2005-09-20

      Fixed, thanks.
      lee

       
    • DavidA

      DavidA - 2005-09-20

      Thanks Lee. Here is the complete list of warnings for your consideration:

      "tinyxml.h", line 698: warning: type qualifier on return type is meaningless

          const int       IntValue() const;
        
      "tinyxml.h", line 699: warning: type qualifier on return type is meaningless

          const double    DoubleValue() const;

      "tinyxml.h", line 1210: warning: type qualifier on return type is meaningless

          const int ErrorId()    const        { return errorId; }
       
      "tinyxmlparser.cpp", line 1314: warning: variable "tabsize" was set but never used

          int tabsize = 4;

      David

       

Log in to post a comment.

MongoDB Logo MongoDB