Lack of return instruction in read_section function defined in tb/dpi/elfloader.cc
Created by: pawelkudlakaldec
'read_section' should return a value. Currently it returns nothing. See code below:
extern "C" char read_section (long long address, const svOpenArrayHandle buffer) { // get actual poitner void* buf = svGetArrayPtr(buffer); // check that the address points to a section assert(mems.count(address) > 0); // copy array int i = 0; for (auto &datum : mems.find(address)->second) { *((char *) buf + i) = datum; i++; } }
It may cause compilation error if gcc gets -Werror=return-type option. See fragment of console below:
tb/dpi/elfloader.cc: In function ‘char read_section(long long int, svOpenArrayHandle)’: tb/dpi/elfloader.cc:63:1: error: control reaches end of non-void function [-Werror=return-type] 63 | } | ^ cc1plus: some warnings being treated as errors