Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1586:7f728c52e63c

Show
Ignore:
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
  • dmd/mars.h

    r1482 r1586  
    413413void error(Loc loc, const char *format, ...) IS_PRINTF(2); 
    414414void verror(Loc loc, const char *format, va_list); 
     415 
     416#ifdef __GNUC__ 
     417__attribute__((noreturn)) 
     418#endif 
    415419void fatal(); 
     420 
    416421void err_nomem(); 
    417422void inifile(char *argv0, const char *inifile); 
  • gen/complex.cpp

    r1571 r1586  
    457457        return DtoCastFloat(loc, re, to); 
    458458    } 
    459     else 
     459    else { 
    460460        error(loc, "Don't know how to cast %s to %s", vty->toChars(), to->toChars()); 
    461 
    462  
     461        fatal(); 
     462    } 
     463
     464 
  • gen/irstate.cpp

    r1535 r1586  
    4040    end = rhs.end; 
    4141    builder.SetInsertPoint(begin); 
     42    return *this; 
    4243} 
    4344 
  • gen/linker.cpp

    r1502 r1586  
    101101    if (!exedir.exists()) 
    102102    { 
    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    }     
    110110 
    111111    // strip debug info 
     
    205205        if (!errstr.empty()) 
    206206            error("message: %s", errstr.c_str()); 
    207         fatal(); 
    208     } 
     207        return status; 
     208    } 
     209 
     210    return 0; 
    209211} 
    210212 
     
    267269    if (!exedir.exists()) 
    268270    { 
    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    }     
    276278 
    277279    // additional linker switches 
     
    340342    args.push_back(NULL); 
    341343 
    342     // try to call linker!!! 
     344    // try to call linker 
    343345    if (int status = llvm::sys::Program::ExecuteAndWait(gcc, &args[0], NULL, NULL, 0,0, &errstr)) 
    344346    { 
     
    346348        if (!errstr.empty()) 
    347349            error("message: %s", errstr.c_str()); 
    348         fatal(); 
    349     } 
     350        return status; 
     351    } 
     352     
     353    return 0; 
    350354} 
    351355 
  • gen/main.cpp

    r1576 r1586  
    961961    { 
    962962        if (global.params.link) 
    963             //status = runLINK(); 
    964             linkObjToExecutable(global.params.argv0); 
     963            status = linkObjToExecutable(global.params.argv0); 
    965964 
    966965        if (global.params.run) 
Copyright © 2008, LDC Development Team.