• LCrawford (unregistered)

    void main(char** argc, int argv) { Frist(); }

    ** Compilation successful, 0 errors

  • bvs23bkv33 (unregistered)

    now I expect story about flawless linkage and flawless runtime

  • Whocares? (unregistered)

    So the guy had no idea the compiler didn't catch all possible errors, but was smart enough to fix them? A bit unbelievable.

  • someone (unregistered) in reply to LCrawford

    Surely a compiler would complain about that immediately? Wouldn't it be an interpreter that wouldn't spit out an error until runtime?

  • (nodebb) in reply to LCrawford

    mcc -O3 -Wall frist.c # My C-Compiler :) mcc: Compiler warning: function definition Frist not found. Assuming int Frist(void). mcc: Linker error: function int Frist(void) not found.

    Addendum 2018-07-19 08:14: Oops. Forgot formatting.

    mcc -O3 -Wall frist.c # My C-Compiler :)
     mcc: Compiler warning: function definition Frist not found. Assuming int Frist(void).
    mcc: Linker error: function int Frist(void) not found.
    
  • RLB (unregistered)

    Funny - a major Dutch supermarket actually is called Jumbo. I doubt they were one of the first in the webshop business, though. IIRC the first in the Netherlands was AH.

  • Wilson (unregistered) in reply to Nutster

    Your compiler compiled that code just fine. Then the linker complained that Frist() didn't exist.

  • Dave (unregistered)

    I've seen the similarly stupid sentiment that you can't have errors in dynamically typed languages because everything can fit into everything.

  • Uuang (unregistered) in reply to someone

    Logic errors my friend

  • J.P (unregistered) in reply to Whocares?

    Look again - Nick didn't fix it, Fred did.

  • TVJohn (unregistered) in reply to Whocares?

    No, it was Fred who fixed the errors.

  • Brian Boorman (google) in reply to Wilson

    Better yet: $ gcc -Werror frist.c /tmp/ccGOW0qp.o: In functionmain': frist.c:(.text+0x15): undefined reference to Frist' collect2: ld returned 1 exit status $

    Addendum 2018-07-19 09:26: Doh...

    $ gcc -Werror frist.c
    /tmp/ccGOW0qp.o: In function `main':
    frist.c:(.text+0x15): undefined reference to `Frist'
    collect2: ld returned 1 exit status
    $
    
  • djingis1 (unregistered) in reply to Whocares?

    No. Fred fixed it.

  • Murray (unregistered) in reply to djingis1

    But it's still weird how Nick ever gets any code to work.

  • siciac (unregistered)

    “We’ve been pestering IBM support, but they haven’t been very helpful.”

    Those customers are the worst...

  • ZB (unregistered)

    This Fred character really sucks at explaining things. It should have been as simple to explain as this:

    Say you've been tasked to write a program that prints "HELLO". Instead you program it to print "GOODBYE". It compiles. Is it correct?

  • DCL (unregistered)

    Had that sort of thing happen to me a few times back in the day. Newbie developer comes to me whining about his/her program crashing and burning while running unit tests with a forlorn wail of "but it compiled without errors!!". Sigh.

  • WTFGuy (unregistered) in reply to ZB

    Close but no cigar. Your example program fails in the sense of not meeting requirements. But it doesn't crash. It runs to completion.

    Idiot Nick in the story seems to believe the compiler can't create crashing code. So if an app crash occurs it's evidence of a defective compiler, OS, or hardware. Of course that's nonsense.

    void main(...) { main(...) } // this'll compile but crash
    void main(...) { throw new Exception(...) } // this'll compile but crash too

    Nick's POV is such nonsense that it really undermines the credibility of the whole tall tale. Assuming the story is true-ish, it makes me wonder if Nick is more like an admin script writer or ETL tool user who's used to living in a safe sandbox. Somehow he got thrown to the wolves to write code in a strange language for an unfamiliar environment and quickly was in way over his head.

  • Olivier (unregistered) in reply to WTFGuy

    In fact, even when writing admin scripts, the first time anyone who ever wrote a program managed to go through compile, the program would not b doing what it was supposed to do (except maybe for hello world).

    Simply because it is almost impossible to get a slightly complex program run true the first time. So surely, Nick has never written any program (this includes scripts)

  • I wish (unregistered)

    "We debugged until it compiled without errors."

    So that's what debugging is.

  • guest (unregistered)

    let's give this the benefit of the doubt and imagine that in his technology unit-tests are a part of compilation process :)))))))))))))))))))))))))))))))

  • Vsg (unregistered) in reply to ZB

    It compiles, runs and at some point terminates, of course it is correct! The question you gotta ask is: "is it doing what it's supposed to do?"

  • 🤷 (unregistered)
    public int ReturnStuff(){
        var frist = 0;
        var second = 10;
        var third = second/frist;
    
        return third;
    }
    

    Compiles without any problems, so it means there are no errors in this code!

  • Duke of New York (unregistered)

    Many of these stories would be a lot shorter if the protagonist just laid cards on the table rather than trying to lead a fool by the nose. “It compiles, but you said it doesn’t run. Forget that it compiles, let’s find the **** bug.”

  • Vsg (unregistered) in reply to Duke of New York

    But there is no bug, don't you understand? It compiles!

  • (nodebb) in reply to 🤷

    And it might run without problems, too. Depending on compiler settings, language concepts, etc.

    You know that a division of a non-zero number by zero results in an infinity, according to IEEE 754?

    0.0/0.0 would result in a NaN, btw. Just another special, but well defined, case.

  • (nodebb)

    cf. https://thedailywtf.com/articles/The-Pesky-e https://thedailywtf.com/articles/Exceptionally-Hard-to-Swallow and others

    Addendum 2018-07-21 09:59: Where did my line breaks go?

    And, addendum:

    and many, many others

  • gnasher729 (unregistered) in reply to I wish

    I did that once, porting a major application from one operating system to another. I switched the compiler and built the project. 4,500 compiler errors. The reason the number was so low was because the compiler stopped counting at 99 errors in a source file. Took me a few months to make it compile without errors. And another day to make it run successfully.

  • Regurgitated rubbish (unregistered) in reply to I wish

    "We debugged until it compiled without errors."

    Pfft. VB was the best, just slap "On Error Resume Next" at the top of every procedure and boom - compiles first time, every time!

  • doubting_poster (unregistered)

    The worst feeling is when you implement a new big feature and it runs the very first time. There's no way I can trust it to function.

Leave a comment on “Classic WTF: Flawless Compilation”

Log In or post as a guest

Replying to comment #:

« Return to Article