This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47151] New: Parsing error


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47151

           Summary: Parsing error
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: chaturvedi.kuldeep@gmail.com


Created attachment 22880
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22880
The  revstr.ii file that contains the complete code which the g++ compiler has
generated

I have created a recursive function but forgot to place a semi-colon at the end
of return statement. The compiler, in fact, did not raise any syntactical
errors. 

Here is the fragment of the code.

void revstr_recursive(char * str, int start, int end) {
   if (start < end)
      revstr_recursive(str, start + 1, end - 1);
   else 
      return

   swap(str[start], str[end]);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]