mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 23:50:43 +03:00
Fix several 'reaches end of function' warnings by making fatal noreturn.
The warnings also pointed out a few genuine bugs. Replace some tabs with spaces.
This commit is contained in:
parent
0db459fad0
commit
64a8e47ad6
5 changed files with 31 additions and 20 deletions
|
@ -412,7 +412,12 @@ void warning(Loc loc, const char *format, ...) IS_PRINTF(2);
|
|||
void vwarning(Loc loc, const char *format, va_list);
|
||||
void error(Loc loc, const char *format, ...) IS_PRINTF(2);
|
||||
void verror(Loc loc, const char *format, va_list);
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((noreturn))
|
||||
#endif
|
||||
void fatal();
|
||||
|
||||
void err_nomem();
|
||||
void inifile(char *argv0, const char *inifile);
|
||||
void halt();
|
||||
|
|
|
@ -456,7 +456,9 @@ DValue* DtoCastComplex(Loc& loc, DValue* val, Type* _to)
|
|||
DImValue* re = new DImValue(extractty, repart);
|
||||
return DtoCastFloat(loc, re, to);
|
||||
}
|
||||
else
|
||||
else {
|
||||
error(loc, "Don't know how to cast %s to %s", vty->toChars(), to->toChars());
|
||||
fatal();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ const IRScope& IRScope::operator=(const IRScope& rhs)
|
|||
begin = rhs.begin;
|
||||
end = rhs.end;
|
||||
builder.SetInsertPoint(begin);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -204,8 +204,10 @@ int linkExecutable(const char* argv0)
|
|||
error("linking failed:\nstatus: %d", status);
|
||||
if (!errstr.empty())
|
||||
error("message: %s", errstr.c_str());
|
||||
fatal();
|
||||
return status;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -339,14 +341,16 @@ int linkObjToExecutable(const char* argv0)
|
|||
// terminate args list
|
||||
args.push_back(NULL);
|
||||
|
||||
// try to call linker!!!
|
||||
// try to call linker
|
||||
if (int status = llvm::sys::Program::ExecuteAndWait(gcc, &args[0], NULL, NULL, 0,0, &errstr))
|
||||
{
|
||||
error("linking failed:\nstatus: %d", status);
|
||||
if (!errstr.empty())
|
||||
error("message: %s", errstr.c_str());
|
||||
fatal();
|
||||
return status;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -960,8 +960,7 @@ LDC_TARGETS
|
|||
else
|
||||
{
|
||||
if (global.params.link)
|
||||
//status = runLINK();
|
||||
linkObjToExecutable(global.params.argv0);
|
||||
status = linkObjToExecutable(global.params.argv0);
|
||||
|
||||
if (global.params.run)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue