Changeset 1586:7f728c52e63c
- Timestamp:
- 11/06/09 15:51:41
(2 years ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
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.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1482 |
r1586 |
|
| 413 | 413 | void error(Loc loc, const char *format, ...) IS_PRINTF(2); |
|---|
| 414 | 414 | void verror(Loc loc, const char *format, va_list); |
|---|
| | 415 | |
|---|
| | 416 | #ifdef __GNUC__ |
|---|
| | 417 | __attribute__((noreturn)) |
|---|
| | 418 | #endif |
|---|
| 415 | 419 | void fatal(); |
|---|
| | 420 | |
|---|
| 416 | 421 | void err_nomem(); |
|---|
| 417 | 422 | void inifile(char *argv0, const char *inifile); |
|---|
| r1571 |
r1586 |
|
| 457 | 457 | return DtoCastFloat(loc, re, to); |
|---|
| 458 | 458 | } |
|---|
| 459 | | else |
|---|
| | 459 | else { |
|---|
| 460 | 460 | error(loc, "Don't know how to cast %s to %s", vty->toChars(), to->toChars()); |
|---|
| 461 | | } |
|---|
| 462 | | |
|---|
| | 461 | fatal(); |
|---|
| | 462 | } |
|---|
| | 463 | } |
|---|
| | 464 | |
|---|
| r1535 |
r1586 |
|
| 40 | 40 | end = rhs.end; |
|---|
| 41 | 41 | builder.SetInsertPoint(begin); |
|---|
| | 42 | return *this; |
|---|
| 42 | 43 | } |
|---|
| 43 | 44 | |
|---|
| r1502 |
r1586 |
|
| 101 | 101 | if (!exedir.exists()) |
|---|
| 102 | 102 | { |
|---|
| 103 | | exedir.createDirectoryOnDisk(true, &errstr); |
|---|
| 104 | | if (!errstr.empty()) |
|---|
| 105 | | { |
|---|
| 106 | | error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str()); |
|---|
| 107 | | fatal(); |
|---|
| 108 | | } |
|---|
| 109 | | } |
|---|
| | 103 | exedir.createDirectoryOnDisk(true, &errstr); |
|---|
| | 104 | if (!errstr.empty()) |
|---|
| | 105 | { |
|---|
| | 106 | error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str()); |
|---|
| | 107 | fatal(); |
|---|
| | 108 | } |
|---|
| | 109 | } |
|---|
| 110 | 110 | |
|---|
| 111 | 111 | // strip debug info |
|---|
| … | … | |
| 205 | 205 | if (!errstr.empty()) |
|---|
| 206 | 206 | error("message: %s", errstr.c_str()); |
|---|
| 207 | | fatal(); |
|---|
| 208 | | } |
|---|
| | 207 | return status; |
|---|
| | 208 | } |
|---|
| | 209 | |
|---|
| | 210 | return 0; |
|---|
| 209 | 211 | } |
|---|
| 210 | 212 | |
|---|
| … | … | |
| 267 | 269 | if (!exedir.exists()) |
|---|
| 268 | 270 | { |
|---|
| 269 | | exedir.createDirectoryOnDisk(true, &errstr); |
|---|
| 270 | | if (!errstr.empty()) |
|---|
| 271 | | { |
|---|
| 272 | | error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str()); |
|---|
| 273 | | fatal(); |
|---|
| 274 | | } |
|---|
| 275 | | } |
|---|
| | 271 | exedir.createDirectoryOnDisk(true, &errstr); |
|---|
| | 272 | if (!errstr.empty()) |
|---|
| | 273 | { |
|---|
| | 274 | error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str()); |
|---|
| | 275 | fatal(); |
|---|
| | 276 | } |
|---|
| | 277 | } |
|---|
| 276 | 278 | |
|---|
| 277 | 279 | // additional linker switches |
|---|
| … | … | |
| 340 | 342 | args.push_back(NULL); |
|---|
| 341 | 343 | |
|---|
| 342 | | // try to call linker!!! |
|---|
| | 344 | // try to call linker |
|---|
| 343 | 345 | if (int status = llvm::sys::Program::ExecuteAndWait(gcc, &args[0], NULL, NULL, 0,0, &errstr)) |
|---|
| 344 | 346 | { |
|---|
| … | … | |
| 346 | 348 | if (!errstr.empty()) |
|---|
| 347 | 349 | error("message: %s", errstr.c_str()); |
|---|
| 348 | | fatal(); |
|---|
| 349 | | } |
|---|
| | 350 | return status; |
|---|
| | 351 | } |
|---|
| | 352 | |
|---|
| | 353 | return 0; |
|---|
| 350 | 354 | } |
|---|
| 351 | 355 | |
|---|
| r1576 |
r1586 |
|
| 961 | 961 | { |
|---|
| 962 | 962 | if (global.params.link) |
|---|
| 963 | | //status = runLINK(); |
|---|
| 964 | | linkObjToExecutable(global.params.argv0); |
|---|
| | 963 | status = linkObjToExecutable(global.params.argv0); |
|---|
| 965 | 964 | |
|---|
| 966 | 965 | if (global.params.run) |
|---|