This is the mail archive of the gcc@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]

NULL_TREE as RETURN_EXPR, but the "return" statement has anargument ...


Hi,

I have a strange behavior of GCC : The source code is the following :

  tlm_status write(ADDRESS_TYPE addr_in,
                   DATA_TYPE * source,
                   int number,
                   int port_id ,
                   basic_metadata& metadata) {
    m_value = *source;
    tlm_status response;
    response.set_ok();
    return response;
  }

and the  tree generated by GCC  has an empty RETURN_EXPR  for the last
line. 

If I change it to 

  tlm_status write(ADDRESS_TYPE addr_in,
                   DATA_TYPE * source,
                   int number,
                   int port_id ,
                   basic_metadata& metadata) {
    m_value = *source;
    tlm_status response;
    response.set_ok();
    return (cout << "hello", response);
  }

Then, I get the tree for the expression (cout << "hello", response). 

Do you have an  explanation for this ? If so, it  would be nice to add
it to the GCC internals manual.

Thanks for your help. 

-- 
Matthieu


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